How do i make a gui appear for everyone in the server when i click a button?

Hi so im new to scripting and i need help making something where when i click a button a gui will appear for the whole server? Can someone help me?? Thanks!

4 Likes

I assume this is a button with a click detector (not a gui button), so do this:

  1. Add a remote event into Replicated Storage
  2. Add the below script into the button you mentioned
script.Parent.ClickDetector.MouseClick:Connect(function()
game.ReplicatedStorage.RemoteEvent:FireAllClients()
end)
  1. Add this script in a LocalScript in StarterGui
game.ReplicatedStorage.RemoteEvent.OnClientEvent:Connect(function()
GUITHING.Visible = true -- Change GUITHING to the frame or button or whatever you want to be visible
end)
5 Likes

I’m sorry that I’m probably not writing on the topic, but at the moment I’m studying the information on how to do this myself. I can offer an alternative.
There is a similar topic on which there is training. It tells how to display text through the developer’s console.

Here is the link .

its a gui button! im new to scipting so im a big noob lols!

wait wouldnt it be the same tho??

Not entirely, I’m not sure how you’d do it, but a ClickDetector only works for a part (brick). Good luck though! You can do this. :grin:

1 Like

Ok if it’s a GUI button, then have a local script in the button which will fire a remote event to the server when it is clicked. Then, have the server fire the remote upon the .OnServerEvent() back to all clients with FireAllClients() and then have local script (ideally located in StarterGui) which will handle this with OnClientEvent:Connect() by making the GUI visible.

2 Likes

Ok so ive wrote the scripts but its not working! so here they are:

Button local script:

script.Parent.MouseButton1Up:Connect(function()
    game.ReplicatedStorage.StartTraining:FireServer()
end)

Server script:

game.ReplicatedStorage.StartTraining.OnServerEvent:FireAllClients()

Enabled local script:

game.ReplicatedStorage.StartTraining.OnClientEvent:Connect(function()

script.Parent.Enabled = true

script.Parent.Text.Disabled = true

end)

can you help me fix these??

Can you show please Output window if there are errors

1 Like

theres non the button just doesnt work

You must use a RemoteEvent.

30 charsssssssss

1 Like

Okay.

  1. Try using MouseButton1Click instead of MouseButton1Up.

  2. There is still one embarrassing moment. “Disabled” option does not work for TextLable. Try to write

Text.Visible = false Instead of Text.Disabled = true

1 Like

Hey there!

Could you please tell me what the Enabled LocalScript’s parent is? Is it a ScreenGui or a TextLabel?

Hey there! I have a rather tougher question. What if someone just deletes the remote event for the gui? I really want everyone to see the gui, but hackers could just delete it :confused:

They can only delete it client-sided so it wouldn’t affect other players