game.Players.LocalPlayer.CharacterAdded just isn't a thing so I don't know what to do. Please help me get the character instance of teh local player from one localscript whenever the character respawns or spawns in the first time.
Thanks :3
pcall(function() wait() game.Players.LocalPlayer.CharacterAdded:Connect(function() print"t" end) end)
The reason it doesn't work is because of the :Wait()
.
The :Wait() yields the script until an event is true, and in your script, the player would have already been in the game which would cause it not to work!
Solution:
Simply remove the wait()
function, and your problem is resolved.
Quick fact: :Waits() are usually 0.03 to 0.07 seconds long!
Also you don't really need a pcall in this case, it's up to you if you want to use it, but it isn't needed here!
Thanks, JesseSong!