write a gmod script that will decrease the delay added into OnTrigger command of any…
- User
write a gmod script that will decrease the delay added into
OnTriggercommand of anytrigger_onceortrigger_multipleorfunc_buttonentities by 5 times, meaning that if it'sOnTrigger: ....., 15, -1, ...., it will become 3, etc - Assistantlua
hook.Add("InitPostEntity", "AdjustTriggerDelays", function() local classes = {"trigger_once", "trigger_multiple", "func_button"} for _, class in ipairs(classes) do for _, ent in ipairs(ents.FindByClass(class)) do if ent.Outputs then for _, output in ipairs(ent.Outputs) do if output.key == "OnTrigger" or output.key == "OnPressed" then output.delay = output.delay / 5 end end end end end end)