Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Help waiting for character to be loaded?

I need a more efficient way for the code to wait for the players character to be loaded.

wait(3)--To make sure the character and other stuff is loaded. I do not know how to make it wait for your character to be loaded
bin = script.Parent
Me = game.Players.LocalPlayer -- I changed it to LocalPlayer instead of your regular one
me = Me
name = "Sky Dragon's Drive"
Backpack = bin.Parent
Player1 = Backpack.Parent
Player = Player1.Character
Hum = Player.Humanoid

These are my variables and Line 9 and up seems to be giving me trouble. If i don't have the Wait, the server says the Player value is nil.

1 answer

✓ Accepted answer

All you have to do is tell it to keep waiting until there's a character.

bin = script.Parent
Me = game.Players.LocalPlayer
me = Me
name = "Sky Dragon's Drive"
Backpack = bin.Parent
Player1 = Backpack.Parent
repeat wait() until Player1.Character -- Wait until there's a character.
Player = Player1.Character
Hum = Player.Humanoid

2 comments

0

I am going to assume that this works because I cannot get on studio right now, but thank you!

0

No problem.

This discussion is preserved as it was. New answers, comments, and votes are closed.