UGCProjects/OneShotKill/Script/Global/EventManager/EventAction/EventAction_EnableInfBullets.lua

26 lines
948 B
Lua
Raw Permalink Normal View History

2025-01-04 23:00:19 +08:00
local EventAction_EnableInfBullets = {
}
-- 触发器激活时将执行Action的Execute
function EventAction_EnableInfBullets:Execute(...)
if UGCGameSystem.IsServer() then
UGCEventSystem.SetTimerLoop(UGCGameSystem.GameState, function()
local AllPlayerPawn = UGCGameSystem.GetAllPlayerPawn()
for i, PlayerPawn in pairs(AllPlayerPawn) do
for k, ShootWeaponEnum in pairs(ShootWeaponEnums) do
local Weapon = UGCWeaponManagerSystem.GetWeaponBySlot(PlayerPawn, ShootWeaponEnum)
if UE.IsValid(Weapon) then
UGCGunSystem.EnableClipInfiniteBullets(Weapon, true)
-- Weapon:ForceModifyCurrentBulletNumInClipOnServer(UGCGunSystem.GetMaxBulletNumInOneClip(Weapon))
end
end
end
end, 0.5
)
end
return true
end
return EventAction_EnableInfBullets