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

Help with this please?

Does LocalPlayer mean your player? What means your player?

1 answer

It means the player associated where the localscript is (I think)

As commented on this answer, you must use a LocalScript instead of a normal script (Which only work in backpack and startergui, I think) Thanks for helping answer chararray256

So if you put it in StarterGui, it is referring to whatever player has the playergui the script is in.

Ex.

If i put the localscript in starterGui that said

print(game.Players.LocalPlayer.Name)

It would print whatever player joined, because the script went from starterGui to the playergui, and it finds the player who owns the specific playergui

This is all based off of what I have seen, it may be 100% wrong.

Note: You can only use LocalPlayer in LocalScripts (I think)

1 comment

1

It only means the current player when it is in a LocalScript. You are partially right as you usually use LocalScripts in StarterGui,

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