The RemoteEvent is under ReplicatedStorage. I’m also going to attach a few other pictures that may help you understand how everything is lined up a bit better.
(The highlighted script is the script in question, the additional scripts apply to the other controls, which all work as expected)
Again, it would be too much to put here, but there is no Output errors linked to it, so I’m not quite sure where it’s going wrong. Again, I’m a relative amateur catching on pretty quick, haha.
You can’t access every client’s PlayerGui from one client’s script. FireAllClients is meant for Server-to-client communication, which is why we need to loop through every player and do it that way.
I’m not sure what the standpoint here is, FireAllClients wouldn’t need iteration through each player. There’d be no need I can see for client-to-client referencing GUI’s here from what I can tell by what OP is trying to achieve. What @LifeDigger and I were suggesting is something structured like this (don’t have studio on hand so forgive me if I write an error):
Localscript
local function onClick()
game.ReplicatedStorage.ControlPanelTest.cruiseannc:FireServer()
end
local function onAnnc()
local Cruising = game:GetService("Players").LocalPlayer.PlayerGui:FindFirstChild("Cruising")
Cruising.Frame1.Visible = true
wait(4)
Cruising.Frame1.Visible = false
Cruising.Frame2.Visible = true
wait(7)
Cruising.Frame2.Visible = false
Cruising.Frame3.Visible = true
wait(9)
Cruising.Frame3.Visible = false
Cruising.Frame4.Visible = true
end
game.ReplicatedStorage.ControlPanelTest.cruiseannc.OnClientEvent:Connect(onAnnc)
script.Parent.MouseButton1Down:Connect(onClick)
What would the placement be for these scripts? I currently have the LocalScript as a child of the button and the ServerScript just placed in the models. Would it remain this way?
This also has no output errors but the GUI still doesn’t want to show.
The only output error is that there is, is that there is no ‘ControlPanelTest’ in ReplicatedStorage. When I deleted ControlPanelTest to make it look directly for the RemoteEvent no additional errors showed up.
Let’s add some debug statements and more explicit references to see where it’s going wrong:
Server script:
local cruiseAnnc = game:GetService("ReplicatedStorage"):WaitForChild("cruiseannc")
cruiseAnnc.OnServerEvent:Connect(function(ply)
print(ply.Name .. " has requested an announcement. Playing sound:")
game.Workspace.ControlPanelTest.AudioBlock.DingDong.Playing = true
print("Firing the event to all the clients:")
cruiseAnnc:FireAllClients(ply.Name)
end)
Local script:
local ply = game:GetService("Players").LocalPlayer
local cruiseAnnc = game:GetService("ReplicatedStorage"):WaitForChild("cruiseannc")
local function onClick()
print("Button clicked, firing at the server...")
cruiseAnnc:FireServer()
end
local function onAnnc(name)
print("Received an announcement from " .. name)
local Cruising = ply.PlayerGui:FindFirstChild("Cruising")
if Cruising then
print("Found the Cruising frame")
Cruising.Frame1.Visible = true
wait(4)
Cruising.Frame1.Visible = false
Cruising.Frame2.Visible = true
wait(7)
Cruising.Frame2.Visible = false
Cruising.Frame3.Visible = true
wait(9)
Cruising.Frame3.Visible = false
Cruising.Frame4.Visible = true
print("Finished!")
else
print("Cruising frame not found! :(")
end
end
cruiseAnnc.OnClientEvent:Connect(onAnnc)
script.Parent.MouseButton1Down:Connect(onClick)
*Edit, forgot to reference the event on client the same way
You can also test multiple players in Studio by going to the “Test” tab, and under the banner for Clients and Servers, select how many players to emulate and hit Start.
UPDATE: When the person clicks the gui button, it will show for the whoever is in the seat. When they click, it will show for them, and when they hop out, I will sit and it will do then show for me.
Is the “Cruising” frame only enabled/parented to the players’ GUI should they be in the seat? Sounds like my snippet of code does work, but something else is contributing to it not working as intended.
Okay, so there’s a bug somewhere. Can you check that the Cruising frame is visible when the client event is executed? Say, try adding a line “Cruising.Visible = true” right under “if Cruising then…”