How to show name to everyone in the server (Help)

Hello!
So I am creating a game and in the game there are booths that users can claim. I want it so that when one person claims the booth, their name shows up on the name text label and everyone be able to see it.

I first made a local script and put it in the surface gui, but it was only showing locally… so then I made a script and put it in serverScriptService which didnt work, then I put it in a regular script in the surface gui and that also did not work. Here is the script for a better look. How do I do this?

--local text = script.Parent
--local player = game.Players.LocalPlayer
local hold = workspace.Folder.Base.claim
local unclaim = workspace.Folder.Base.unclaim

unclaim.Enabled = false

hold.Triggered:Connect(function(player)
	local text = script.Parent
	local player = game.Players.LocalPlayer
	text.Text = player.DisplayName
	hold.Enabled = false
	wait(1)
	unclaim.Enabled = true
end)

unclaim.Triggered:Connect(function(player)
	local text = script.Parent
	text.Text = "name"
	unclaim.Enabled = false
	wait(1)
	hold.Enabled = true
end)







1 Like

Just create a bool value and an object value inside the booth, the bool value to check if its claimed/unclaimed, and the object value should be the object of the player who claimed it, then you can simply detect if the bool value changed and set the text to something like

local player = objectvalue.Value
text = player.Name .. "'s Booth"

then do the same for when a player leaves or unclaims it, simply set the value to false and the text to “Unclaimed Booth”

(do this through a localscript because the values are on the server)

you can also use a stringvalue instead of an objectvalue, so that you don’t need to use .Name

Like this?
image
image

Is this a local or server script?
[The one in your original post]

the value inside the booth, not the surfacegui, that way everyone’s client will update the surfacegui

it is a local script inside of a gui located in Starter gui :slightly_smiling_face:

Then you’d need to use a remote event to show what you need for the entire server.

I tired that as well but is not working, unless I did something else and do not understnand exactly whaty yopu mean

So basically, you have a booth model in the workspace, and the surfaceGui in the starterGui, you have to put the localscript inside the surfaceGui, and the value/s inside the booth model so that it isn’t client sided

im still confused… im news to this add me on discord if you have it

Zallion#3026