Scripting gui help(easy script?)

Hi,

I am trying to script a gui which pops up, when a part is touched/stepped on.

But the thing is when the part is stepped on, the gui opens up for everyone.

I have tried using remove events and local scripts, but it won’t work, any solutions???

image – this is the server side script
image – this is the local script.

image this error pops up, i don’t know how to fix it

Could we see the script? It’d help us know what issue we’re dealing with :slightly_smiling_face:

ok, sorry about that, one sec.

You can use a :GetPlayerFromCharacter() event when you touch the brick!

Example:

 part.Touched:Connect(function(hit)
      local player = game.Players:GetPlayerFromCharacter(hit.Parent)
       
      game.ReplicatedStorage.OpenGui:FireClient(player)
 end

Then just get it from the LocalScript to open the Gui and you’re good to go!

Example:

 game.ReplicatedStorage.OpenGui.OnClientEvent:Connect(function()
      script.Parent.Frame.Visible = true
 end

Hope this helps!

does this fix the error that keeps popping up?

Yep! Should since when you get the player, you’re getting the player instance.