Hello, so I have just inserted a localscript in StarterCharacterScripts and... I want to access the player, what’s wrong with my script?
Also I appreciate upvotes :)
local Player = game.LocalPlayer
print(player)
Hello, so I have just inserted a localscript in StarterCharacterScripts and... I want to access the player, what’s wrong with my script?
Also I appreciate upvotes :)
local Player = game.LocalPlayer
print(player)
You forgot to add Players between game and LocalPlayer:
local Player = game.Players.LocalPlayer
StarterCharacterScripts is for accessing the character only. The character is like the NPC, except the player controls the said NPC. If you want to access the player only, then change it to StarterPlayerScripts. Also printing the instance is not allowed, and it would break your script. So the proper print is this:
local player = game.Players.LocalPlayer
print(tostring(player))
Nitpicks: You didn't capitalise Player at the 2nd line. You were supposed to write game.Players.LocalPlayer not game.LocalPlayer. Also you can't print instances unless if you use the tostring() function.
Thank you, hey I’ve been trying to do a certain script in Roblox studio for a while (not this one) but a different one but I don’t know how can you help me?
Post a separate question and I'll see it.
Ok
I asked the question dovy
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
Oh thank you!