26 lines
738 B
Lua
26 lines
738 B
Lua
---@class BP_KillBox_C:AActor
|
|
---@field Box UBoxComponent
|
|
---@field DefaultSceneRoot USceneComponent
|
|
--Edit Below--
|
|
---@type BP_KillBox_C
|
|
local BP_KillBox = {};
|
|
|
|
function BP_KillBox:ReceiveBeginPlay()
|
|
self.SuperClass.ReceiveBeginPlay(self);
|
|
if UGCGameSystem.IsServer() then
|
|
self.Box.OnComponentBeginOverlap:Add(self.Box_OnComponentBeginOverlap, self);
|
|
end
|
|
end
|
|
|
|
function BP_KillBox:Box_OnComponentBeginOverlap(OverlappedComponent, OtherActor, OtherComp, OtherBodyIndex, bFromSweep, SweepResult)
|
|
local PlayerKey = OtherActor.PlayerKey
|
|
if PlayerKey then
|
|
OtherActor:K2_DestroyActor()
|
|
UGCGameSystem.GameMode:Server_RespawnPlayer(PlayerKey)
|
|
end
|
|
return nil;
|
|
end
|
|
|
|
-- [Editor Generated Lua] function define End;
|
|
|
|
return BP_KillBox; |