Ok, so I am making a school bus spawner. There is a GUI (Stored in StarterGUI) that has a frame with a bunch of buttons, in each of those buttons there's a local script that fires the server with the specific school bus type. In the handler for the RemoteEvent (Stored in replicated storage), it should detect when the OnServerEvent, and look for the bus type that got sent through the local script and spawn the specific one in. But it dosen't, and no output errors either. I tried messing with it for an hour straight and nothing.
LOCALSCRIPT (The parent for this script is the button)
local SelF = script.Parent.Parent
script.Parent.MouseButton1Down:connect(function()
game.ReplicatedStorage.BusSpawner:FireServer("CEOLD")
SelF.Visible = false
end)
SERVER SCRIPT (The parent for this script is the RemoteEvent)
local CE = script.Parent.Parent.ICCE300
local CEWC = script.Parent.Parent.ICCE300WC
local CEOLD = script.Parent.Parent.ICCE2004
local C2 = script.Parent.Parent.THOMASC2
local C2WC = script.Parent.Parent.THOMASC2HANDICAP
local function ServerTriggered (bus)
if bus == "ICCE" then
local busce = CE:Clone()
busce.Parent = workspace
elseif bus == "ICCEWC" then
local buscewc = CEWC:Clone()
buscewc.Parent = workspace
elseif bus == "CEOLD" then
local busceold = CEOLD:Clone()
busceold.Parent = workspace
elseif bus == "C2" then
local busc2 = C2:Clone()
busc2.Parent = workspace
elseif bus == "C2WC" then
local busc2wc = C2WC:Clone()
busc2wc.Parent = workspace
end
end
script.Parent.OnServerEvent:Connect(ServerTriggered)
I definetly know its a problem with the client because I tried debuging the server script with print("server") before the if statement and nothing came up.

1 comment
Thank you so much! Knowing this now could probably fix a bunch of other things I gave up on lol.