Hi! I am trying to script a Gate System, however I am having a few issues on how to implement the SurfaceGui and changing it on the correct gate. I currently have it set up so when you click “Update Details” on GUI 1 below, it will send a RemoteEvent to a server, which fires it to all clients, and then the SurfaceGui will catch that remotevent and check if the GateName variable that’s passed is matching to the SurfaceGui’s adornee name parent ( which is the Gate ), however for some odd reason I am not seeing the print at all after the RemoteEvent is sent. I’ve tried moving it to and from StarterGui, and the gate screen itself.
GUI 1:
GUI 1 Update Details Script:
Summary
script.Parent.MouseButton1Click:Connect(function()
local GateName = script.Parent.Parent.Parent.Gate.Value
local GateNum = script.Parent.Parent.Parent.GateNum.Text
local FlightNum = script.Parent.Parent.Parent.FlightNum.Text
local Depart = script.Parent.Parent.Parent.Depart.Text
local Arrival = script.Parent.Parent.Parent.Arrival.Text
game.ReplicatedStorage.CasualTech.GateSystemV1.UpdateValues:FireServer(GateName, Depart, Arrival, FlightNum, GateNum)
print("Sent")
end)
Receiving SurfaceGui Script:
Summary
game.ReplicatedStorage.CasualTech.GateSystemV1.UpdateValues.OnClientEvent:Connect(function(GateName, DepartValue, DestinationValue, FlightNumber, GateNumber)
print("GotUpdate")
local GateNamee = game.Workspace.CasualTech.GateSystemV1[GateName]
for _,Gate in pairs(game.Workspace.CasualTech.GateSystemV1:GetChildren()) do
if Gate.Name == GateNamee and script.Parent.Parent.Adornee.Name == GateName then
print("Matches")
script.Parent.Depart.mainLabel.Text = DepartValue
script.Parent.Arrival.mainLabel.Text = DestinationValue
script.Parent.FlightNum.mainLabel.Text = FlightNumber
script.Parent.GateName.mainLabel.Text = GateName
print("GateOne | Done")
end
end
end)
Server Script:
Summary
game.ReplicatedStorage.CasualTech.GateSystemV1.UpdateValues.OnServerEvent:Connect(function(plr, GateName, DepartValue, DestinationValue, FlightNumber, GateNumber)
game.ReplicatedStorage.CasualTech.GateSystemV1.UpdateValues:FireAllClients(GateName, DepartValue, DestinationValue, FlightNumber, GateNumber)
print("Done")
end)
I tend to over-complicate things, so this may just be a small issue but I will still need helping figuring it out
Edit; Typo- Still having an issue however