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!
I assume this is a button with a click detector (not a gui button), so do this:
- Add a remote event into Replicated Storage
- Add the below script into the button you mentioned
script.Parent.ClickDetector.MouseClick:Connect(function()
game.ReplicatedStorage.RemoteEvent:FireAllClients()
end)
- 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)
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.
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.
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
theres non the button just doesnt work
You must use a RemoteEvent.
30 charsssssssss
Okay.
-
Try using MouseButton1Click instead of MouseButton1Up.
-
There is still one embarrassing moment. “Disabled” option does not work for TextLable. Try to write
Text.Visible = false
Instead of Text.Disabled = true
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
They can only delete it client-sided so it wouldn’t affect other players