Want a special badge and 30 bux? Make some PolyWorld! Content and post it in the Creations forum!
Dark mode is incomplete! Please report any issues to the Discord.

RunModule

LocalScripts Scripts Not creatable

RunModule tells you where code is running and gives per-frame / per-step events.
Available as the global RunModule.


Overview

Properties

Events


API

Properties

IsServer

IsServer readonly : bool
true when this code is running on the server (Scripts).

IsClient

IsClient readonly : bool
true when this code is running on a client (LocalScripts).

IsPlaytest

IsPlaytest readonly : bool
true when the place is running inside Studio playtest.

Events

Frame

Frame : Event (deltaTime: number)
Client only.
Fires once per rendered frame.
deltaTime is seconds since the last frame.

if RunModule.IsClient then
    RunModule.Frame:Connect(function(dt)
        -- client frame logic
    end)
end

Stepped

Stepped : Event (deltaTime: number)
Server only.
Fires once per server simulation step.
deltaTime is seconds since the last step.

if RunModule.IsServer then
    RunModule.Stepped:Connect(function(dt)
        -- server step logic
    end)
end