Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I run code when the player is for sure in the game and is all loaded in?

Asked by
Nimbzee 14
5 years ago

I'm not sure, but do you use player added pr something similar to that? for example (i dont know how to use player added or set it up)

--localplayer added  part

--code 
print"this is where the code goes and localplayer loaded in "

end

if you need any clarifictaion ask! thanks

1 answer

Log in to vote
0
Answered by
royaltoe 5144 Moderation Voter Community Moderator
5 years ago
Edited 5 years ago

You can have a local script inside of the StarterCharacterScripts This is where you'd find it.

The scripts inside there run every time the character loads into game

if you only want to do something ONCE when the

edit: you can also do this to make code run whenever a player joins a game

game.Players.PlayerAdded:Connect(function(player)
    print("A player has entered: " .. player.Name)
end)
0
thanks! Nimbzee 14 — 5y
0
Added some stuff to my answer. You can also do something once a player joins the game for the first time with PlayerAdded. But it has to be somewhere such as the workspace or serverscriptservice to work. royaltoe 5144 — 5y
Ad

Answer this question