58 lines
1.4 KiB
Lua
58 lines
1.4 KiB
Lua
---@class BP_ResetHeight_C:AActor
|
|
---@field Box UBoxComponent
|
|
---@field DefaultSceneRoot USceneComponent
|
|
--Edit Below--
|
|
local BP_ResetHeight = {
|
|
CheckTime = 1;
|
|
ActorHeightZ = -2000;
|
|
};
|
|
|
|
|
|
function BP_ResetHeight:ReceiveBeginPlay()
|
|
self.SuperClass.ReceiveBeginPlay(self);
|
|
if UGCGameSystem.IsServer() then
|
|
self.ActorHeightZ = self:K2_GetActorLocation().Z
|
|
self.CheckPlayerHeightHandle = UGCEventSystem.SetTimerLoop(self, self.CheckPlayerHeight, self.CheckTime)
|
|
end
|
|
end
|
|
|
|
function BP_ResetHeight:CheckPlayerHeight()
|
|
local AllPawn = UGCGameSystem.GetAllPlayerPawn()
|
|
for i, v in pairs(AllPawn) do
|
|
if v:K2_GetActorLocation().Z < self.ActorHeightZ and v:IsAlive() then
|
|
UGCEventSystem.SendEvent(EventEnum.ResetPlayerTransformToPlayerStart, v:GetController(), v)
|
|
--if GlobalConfigs.GameSetting.bEnableDropDamage then
|
|
-- UGCPawnAttrSystem.SetHealth(v, -1)
|
|
--else
|
|
-- UGCSystemLibrary.RespawnPlayer(v.PlayerKey)
|
|
--end
|
|
end
|
|
end
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function BP_ResetHeight:ReceiveEndPlay()
|
|
if self.CheckPlayerHeightHandle then
|
|
UGCEventSystem.StopTimer(self.CheckPlayerHeightHandle)
|
|
end
|
|
self.SuperClass.ReceiveEndPlay(self);
|
|
end
|
|
|
|
|
|
--[[
|
|
function BP_ResetHeight:GetReplicatedProperties()
|
|
return
|
|
end
|
|
--]]
|
|
|
|
--[[
|
|
function BP_ResetHeight:GetAvailableServerRPCs()
|
|
return
|
|
end
|
|
--]]
|
|
|
|
return BP_ResetHeight; |