Example:game.Players.LocalPlayer
Questions! What does LocalPlayer Do In a script? What Funtion Can This Make?
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:
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!