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

What is LocalPlayer?What Is LocalScript?

Example:game.Players.LocalPlayer

Questions! What does LocalPlayer Do In a script? What Funtion Can This Make?

2 answers

LocalPlayer is the client's player. You can call clones and access the player's Backpack, StarterGear, and PlayerGui.

Here's the wiki article with more information on how to use it:

ROBLOX Wiki: LocalPlayer

2 comments

0

Thank For Your Help!

0

No problem! Make sure to accept the answer on the side! :)

In a LocalScript, using the LocalPlayer property of the Players service will give you the player that has the script, which is the LocalPlayer. For example, in a LocalScript, if you have this code, then the player will be killed.

game.Players.LocalPlayer.Character.Humanoid.Health = 0 -- Notice how the 'LocalPlayer' property of the Players service is used.

Hope this helps!

1 comment

0

Thank For Your Help!

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