So I was told to reduce the script.Parents to make it easier. I have done that, now it isn't working at all. The problem before was that it was stuck on "Spawning..." but now it's just not working.

DaScript = script.Parent.RBXStudioTutorial
Frame = script.Parent.Parent
C70 = Frame:WaitForChild("Set1")
local Player = game.Players.LocalPlayer
GUI = Player.PlayerGui.MainMenuGui
local train = game.ReplicatedStorage.C70Freight
local Camera = workspace.CurrentCamera
local DriveFrame = GUI.Screen.DriveFrame
local Spawning = GUI.Spawning
local Character = game.Players.LocalPlayer.Character
		
function C70Clicked()
	if workspace:IsRegion3Empty(Region3.new(Vector3.new(467.505, 6.548, -3076.283), Vector3.new(1152.544, 6.559, -3298.865))) then
		DriveFrame.Visible = false
		Spawning.Visible = true
		Spawning.Text = "Spawning..."
		wait(0.01)
		local clone = train:Clone()
		clone.Parent = workspace
		clone:MakeJoints()
		clone.Bogies.SD_Bogie2:MakeJoints()
        clone.Bogies.SD_Bogie:MakeJoints()
		wait(1)
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)
		script.Disabled = true
	else
DriveFrame.Visible = false
Spawning.Visible = true
Spawning.Text = "Spawning..."
wait(1)
Spawning.Text = "Spawn Occupied! Please wait."
wait(1)
DriveFrame.Visible = true
Spawning.Visible = false
	end
end


C70.MouseButton1Click:connect(C70Clicked)


2 comments

0

Any errors in the output?

0

I fixed it a few hours ago