61 lines
1.4 KiB
Lua
Raw Normal View History

2025-01-08 22:46:12 +08:00
---@class BP_KillBox_C:AActor
---@field Box UBoxComponent
---@field DefaultSceneRoot USceneComponent
--Edit Below--
local BP_KillBox = {
};
function BP_KillBox:ReceiveBeginPlay()
self.SuperClass.ReceiveBeginPlay(self);
if self:HasAuthority() then
self.Box.OnComponentBeginOverlap:Add(self.Box_OnComponentBeginOverlap, self);
end
end
function BP_KillBox:Box_OnComponentBeginOverlap(OverlappedComponent, OtherActor, OtherComp, OtherBodyIndex, bFromSweep, SweepResult)
if UGCGameSystem.IsServer() then
local PlayerKey = OtherActor.PlayerKey
if PlayerKey then
--OtherActor:K2_DestroyActor()
-- 重生玩家
-- UGCGameSystem.GetRespawnComponent():AddRespawnPlayer(PlayerKey, 0)
else
if UE.IsA(OtherActor, UE.LoadClass(UGCGameSystem.GetUGCResourcesFullPath('Asset/Blueprint/Monster/BP_MonsterBase.BP_MonsterBase_C'))) then
-- 设置血量 == 0
UGCSimpleCharacterSystem.SetHealth(OtherActor, -1)
--UGCGameSystem.ApplyDamage(OtherActor, 2^30, )
--UGCPawnAttrSystem.SetHealth(OtherActor, 0)
--OtherActor:K2_DestroyActor()
end
end
end
return nil;
end
--[[
function BP_KillBox:ReceiveTick(DeltaTime)
self.SuperClass.ReceiveTick(self, DeltaTime);
end
--]]
--[[
function BP_KillBox:ReceiveEndPlay()
self.SuperClass.ReceiveEndPlay(self);
end
--]]
--[[
function BP_KillBox:GetReplicatedProperties()
return
end
--]]
--[[
function BP_KillBox:GetAvailableServerRPCs()
return
end
--]]
return BP_KillBox;