0
0
mirror of https://gitlab.com/YuukiPS/GC-Resources.git synced 2025-04-29 09:35:48 +00:00
GC-Resources/Resources/Scripts/Gadget/MoleDestination.lua
KingRainbow44 b8cde25332
Revert "The Great De-Local'ifying of Lua Scripts (pt. 3)"
This reverts commit aa45c07369da944f31842aaadf87884dc319c8b1.
2023-08-29 21:28:58 -04:00

39 lines
1.2 KiB
Lua
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

local _delay = 10
-- ¶¨Ê±Æ÷»Øµ÷
function OnTimer(context, now)
-- »ñÈ¡»ú¹Øµ±Ç°×´Ì¬
local state = ScriptLib.GetGadgetState(context)
if state ~= GadgetState.GearAction1 then
-- »ñÈ¡µ±Ç°×´Ì¬µÄ¿ªÊ¼Ê±¼ä
local state_begin_time = ScriptLib.GetGadgetStateBeginTime(context)
if now >= state_begin_time + _delay then
-- Èç¹ûÆô¶¯Ê±¼ä³¬¹ýÆô¶¯³ÖÐøÊ±¼ä£¬Ôòת»»ÎªDefault״̬
ScriptLib.SetGadgetState(context, GadgetState.GearStart)
end
end
end
function OnClientExecuteReq(context, param1, param2, param3)
if param1 == 0 then
ScriptLib.SetGadgetState(context, GadgetState.Default)
end
if param1 == 201 then
ScriptLib.SetGadgetState(context, GadgetState.GearStart)
end
if param1 == 202 then
ScriptLib.SetGadgetState(context, GadgetState.GearStop)
end
if param1 == 203 then
ScriptLib.SetGadgetState(context, GadgetState.GearAction1)
end
if param1 == 204 then
ScriptLib.SetGadgetState(context, GadgetState.GearAction2)
end
if param1 == 901 then
ScriptLib.SetGadgetState(context, GadgetState.Action01)
end
if param1 == 902 then
ScriptLib.SetGadgetState(context, GadgetState.Action02)
end
end