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

Is it possible to find a Player without a LocalScript?

If there is, it would help me tremendously.

4 comments

0

Which player are you trying to get? A random one? The first one? One that touched a part?

0

Yes there is. A lot in fact, but it depends on what your making and which player you are trying to get.

0

I'm trying to get the player that clicks a SurfaceGui ImageButton.

0

Oh, wait, I got it working.

2 answers

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.

2 comments

0

Not exactly what I meant, but thanks for trying!

0

I tried Player = game.Players:GetPlayers() print(Player.Name) it returned nil...

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.

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