RunModule tells you where code is running and gives per-frame / per-step events.
Available as the global RunModule.
Overview
Properties
- .IsServer readonly : bool
- .IsClient readonly : bool
- .IsPlaytest readonly : bool
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
