27 lines
1.0 KiB
Lua
27 lines
1.0 KiB
Lua
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)
|
||
-- UGCGunSystem.EnableInfiniteBullets(Weapon, false)
|
||
-- Weapon:ForceModifyCurrentBulletNumInClipOnServer(UGCGunSystem.GetMaxBulletNumInOneClip(Weapon))
|
||
end
|
||
end
|
||
end
|
||
end, 0.5
|
||
)
|
||
end
|
||
|
||
|
||
return true
|
||
end
|
||
|
||
return EventAction_EnableInfBullets |