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

How to make a sign that shows all the players on a part?

Hello everyone. I'm currently working on a game inspired by Flicker and Murder Island 2 and I was wondering how to make something like this. Thanks.

1 comment

0

flicker mystery 2 xd

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.