I have no idea whats going on. i have a button on a surface gui thats supposed to change a text label’s background color. The only weird thing is that everytime you sit on a special seat, the gui pops up. Its meant to be operated by multiple players. In a transcript, heres how its supposed to go.
The person sitting in the seat, with the gui open on their screen, clicks a button.
A button appears on a surface gui thats next to another player.
When the second player, with control of clicking the button on the surface gui clicks the button, the textlabel on the first persons screen changes color.
Thats how its supposed to go, but it wont work on my script
local indicator = game.StarterGui.GunRangeControl.Main.Control.One.ReadyLabel
local button = game.Workspace.sh1.SurfaceGui1.Frame.Ready
local screen1 = game.Workspace:WaitForChild("sh1")
button.MouseButton1Click:Connect(function()
game.StarterGui.GunRangeControl.Main.Control.BackgroundColor3 = Color3.new(0, 1, 0.498039) --attempt on making the textlabel for the person sitting to change color
screen1.SurfaceGui1.Frame.Ready.Visible = false
screen1.SurfaceGui1.Frame.Clickready.Text = "GET READY TO SHOOT." --ignore
end)
You’re going to need to make use of a RemoteEvent and a server script in order to achieves what you want, as the client can only directly change what it sees (and hence not what other players can see)
I tried that already, i used a script that would fire the event when the surface gui button is pressed, leading it to a server script with the function
Parent the button’s SurfaceGui to StarterGui and set its Adornee to workspace.sh1. Also, players won’t see GUI changes done to UI elements in StarterGui, you have to modify the instances in the player’s PlayerGui folder.
Your SurfaceGui needs to be in the StarterGui service with its Adornee set to the part it’s showing up on.
To show changes to GUI elements on another players screen, you can use RemoteEvents to have one client tell the server to tell another client to update their GUIs. Since everything in StarterGui is cloned to each player’s PlayerGui, you can access this by doing player.PlayerGui.GuiElement.