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

Module scripted parented to a local script runs before player loads, have to reset for it to work?

Asked by 2 years ago

As the title says, I have a module script which has a parent, local script but it runs before the player loads rendering it useless until you reset, then it works fine. How can I fix this?

1 answer

Log in to vote
2
Answered by
enes223 327 Moderation Voter
2 years ago

You can wait for local player's character to load with the CharacterAdded event on the player, you just need to wait for the event to fire, example script:

local plr = game.Players.LocalPlayer
plr.CharacterAdded:Wait()
print("Character loaded!")
Ad

Answer this question