COMMUNITY QUESTION
How to make a sign that shows all the players on a part?
1 answer
You can add a SurfaceGui to display the player names.
Sample Code:
local playersService = game:GetService("Players")
local text = ""
local part = workspace.ToTouchPart
part.Touched:Connect(function(gotPart)
if playersService:GetPlayerFromCharacter(gotPart.Parent) then
for _, player in pairs(playersService:GetPlayers()) do
text = text.." "..player.Name
end
end
end)
4 comments
0
Thanks, but how do I make it appear when I touch a part?
0
Code has been updated.
0
Why use playerservice when you can just check for a humanoid?
0
It's a good practice, especially since it's just for players, not NPC's.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
flicker mystery 2 xd