Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

What is LocalPlayer?What Is LocalScript?

Asked by 10 years ago

Example:game.Players.LocalPlayer

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

2 answers

Log in to vote
2
Answered by
TofuBytes 500 Moderation Voter
10 years ago

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

0
Thank For Your Help! Wilbert026 10 — 10y
0
No problem! Make sure to accept the answer on the side! :) TofuBytes 500 — 10y
Ad
Log in to vote
0
Answered by
Seraine 103
10 years ago

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!

0
Thank For Your Help! Wilbert026 10 — 10y

Answer this question