Events
Inherited Events
From SharedEvents
:
ResourceStart: (resource: string)
Called when resource starts when a client joins the server. The first argument is the name of the resource that started. If you want to enable abilities for the local player, you should do it here (only on the client).
Event.Add("ResourceStart", function(resource)
if resource == Resource.Name then
Local.UnlockAbility(Ability.GrapplingHook)
Local.UnlockAbility(Ability.Parachute)
Local.UnlockAbility(Ability.Wingsuit)
Local.UnlockAbility(Ability.ExitVehicle)
end
end)
ResourceStop: (resource: string)
Called when resource stops. The first argument is the name of the resource that stopped.
ServerEvents
Events:
PlayerJoin: (player: PlayerClient)
This fires when a player client joins the server. This does not guarantee that the player has loaded their scripts yet, so do not try to send them data yet.
Event.Add("PlayerJoin", function(player)
print("Player " .. player:GetNick() .. " joined the server!")
end)
PlayerQuit: (player: PlayerClient)
This fires when a player client leaves the server.
Event.Add("PlayerQuit", function(player)
print("Player " .. player:GetNick() .. " left the server!")
end)
PreTick: ()
This fires every tick on the server before any server logic is run.
Event.Add("PreTick", function()
print("PreTick! Elapsed seconds: " .. tostring(Server.GetElapsedSeconds()))
end)
PostTick: ()
This fires every tick on the server after all server logic is run.
Event.Add("PostTick", function()
print("PostTick! Elapsed seconds: " .. tostring(Server.GetElapsedSeconds()))
end)
PlayerResourceAction: (player: PlayerClient, resource: string, action: ResourceAction)
This fires when a player's resource is started, stopped, or restarted. See ResourceAction for more information on types of actions. If you want to send data to a player when they connect, you should do it here since there resource is fully loaded (on ResourceAction.Start).
Event.Add("PlayerResourceAction", function(player, resource, action)
print("Player " .. player:GetNick() .. " " .. action .. " resource " .. resource)
end)