How do I make this Bilboard GUI only show for the player and not go on everyone elses head?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I want to make it so when you touch this button, It will make an overhead GUI appear, but only for you and not the whole server
    image
    image
    Context: Player1 Touched the part, Player1 got the GUI on his end, but so did Player2. It is showing the original billboardGUI on each player even though both players have the second GUI on their head. I want it to show the second GUI to only the player who touched the brick

  2. What is the issue? Include screenshots / videos if possible!
    When I touch the button, the GUI appears, but it will appear on top of EVERY players head instead of whoever touched the brick

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I tried to put it into the player GUI but I do not know how to do it properly without it just dissapearing

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

local brick = game.Workspace:WaitForChild("EventGUIPopup")
local gui = script.Parent
local gui1 = script.Parent.Parent.BillboardGui

brick.Touched:Connect(function()
	gui.Enabled=true
	gui1.Enabled=false
end)

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

1 Like

If the button code runs in a local script, changes won’t replicate, meaning only that single player will see them(basically they won’t exist on the server side, as if they were never made).

It is in a local script inside the bilboard gui

Use a remote event to hide/show the gui

in regular script

brick.Touched:Connect(function(hit)
	if hit.Parent:FindFirstChild("Humanoid") then
		local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
		remoteEvent:FireClient(plr)
	end
end)

In Local Script

remoteEvent.OnClientEvent:Connect(function()
	gui.Enabled=true
	gui1.Enabled=false
end)

About Remote Events/Functions in 5 mins

3 Likes

Oh I see, I assume you copied the script multiple times, so when the brick is touched by anybody, it activates all those copied local scripts at once, causing this effect. What you need to do instead is create a relation between the UI you want to enable and the brick being touched, for example, a link related to the player touching the brick:

brick.Touched:Connect(function(hit)
	local player = game.Players:GetPlayerFromCharacter(hit.Parent)
	if not player then return end
	local character = player.Character
	--get the correct UI from the player or character path and activate that
end)

The code above will still fire all the .Touched events in the multiple local scripts running in parallel but ignore them all unless the player touching the brick is related to the UI being activated. Of course for the above code sample to work you need to figure out the path from the character to gui and gui1, and then use their .Enabled properties as you wish to achieve the desired result.

Thank you, this worked flawless. I tried using remotes earlier but I guess I did it wrong lol.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.