Reference Verse

Buff players inside a zone and remove it when they leave: subscribe to enter/exi

Updated
The code on this reference page is provided as-is and did not pass the latest compile check — treat the examples as a starting point and verify in your project.

Buff players inside a zone, undo it when they leave.

SpeedZone.AgentEntersEvent.Subscribe(OnEnter)
SpeedZone.AgentExitsEvent.Subscribe(OnExit)
OnEnter(Agent:agent):void =
    SpeedBuff.Pickup(Agent)
OnExit(Agent:agent):void =
    SpeedBuff.Remove(Agent)

Takeaway — Enter grants, exit reverts — the zone owns the buff.

Build your own lesson with zone_based_buff

Generate a personalized, step-by-step lesson plan built around this object — grounded in this exact reference and our compile-verified knowledge base.

Build a lesson →