I decided to try remote events with my spawning script. However, they are not working as I'm new to remote events. The event does fire, the server script isn't picking it up though.
Server Script (in ReplicatedStorage):
train = game.ReplicatedStorage.C70Freight
Camera = workspace.CurrentCamera
DriveFrame = GUI.Screen.DriveFrame
Spawning = GUI.Screen.Spawning
script.Parent.Parent.Events.C70Spawn.OnServerEvent:connect(function(player)
GUI = player.PlayerGui.MainMenuGui
DriveFrame.Visible = false
Spawning.Visible = true
Spawning.Text = "Spawning..."
wait(0.01)
local clone = train:Clone()
clone.Parent = workspace
clone:MakeJoints()
wait(1)
player.Character.HumanoidRootPart.CFrame = CFrame.new(610.265, 6.551, -3143.202)
Spawning.Visible = false
player.CameraMode = "Classic"
Camera.CameraType = "Custom"
Camera.FieldOfView = 80
wait(1)
GUI.Screen.IntroMusic:Stop()
end)
LocalScript (in Gui)
Frame = script.Parent.Parent
C70 = Frame:WaitForChild("Set1")
Player = game.Players.LocalPlayer
function C70Clicked()
if workspace:IsRegion3Empty(Region3.new(Vector3.new(467.505, 6.548, -3076.283), Vector3.new(1152.544, 6.559, -3298.865))) then
game.ReplicatedStorage.Events.C70Spawn:FireServer()
else
script.Parent.Text = "Spawn Occupied! Please Wait."
wait(1)
script.Parent.Text = "4 Wagons"
end
end
C70.MouseButton1Click:connect(C70Clicked)

5 comments
Scripts do not run in ReplicatedStorage. Try ServerScriptService instead.
Ah right.
It works in Studio, but not in Client?
the client and the server is separated in game, press F9, go to client and server log and post the error if any
I did end up fixing it, I forgot to publish the game lmao