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

Is it possible to find a Player without a LocalScript?

Asked by
Spooce 78
9 years ago

If there is, it would help me tremendously.

0
Which player are you trying to get? A random one? The first one? One that touched a part? jakedies 315 — 9y
0
Yes there is. A lot in fact, but it depends on what your making and which player you are trying to get. ultimate055 150 — 9y
0
I'm trying to get the player that clicks a SurfaceGui ImageButton. Spooce 78 — 9y
0
Oh, wait, I got it working. Spooce 78 — 9y

2 answers

Log in to vote
0
Answered by 9 years ago
game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(char)
game.Workspace.Part.Touched:connect(function(hit)
hit = char:FindFirstChild("Humanoid")
if hit then
hit.Humanoid.Health = 0
end
end)
end)

I have no idea if that works.

0
Not exactly what I meant, but thanks for trying! Spooce 78 — 9y
0
I tried Player = game.Players:GetPlayers() print(Player.Name) it returned nil... BosswalrusTheCoder 88 — 9y
Ad
Log in to vote
0
Answered by
Pixxels 45
9 years ago

When do you want to use it, when someone touches a brick or what? What are you going to do it the information so to say.

Answer this question