I made this script earlier to use on my Starship. I apologise for the messiness. When I activate the script, it does nothing and the output says nothing. The script itself checks if a value is set to a certain place, then grabs the "warp" from ServerStorage into Workspace for 12 seconds, destroys it, then takes the place from ServerStorage and puts it in Workspace

function warp()
if game.Workspace.EngineeringDeck.Core.Ejected ~= true then
	if game.Workspace:FindFirstChild("warp") == nil then
		game.Workspace.BridgeDeck.Bridge.Helm.Part.Sound.Pitch = 1
		game.Workspace.BridgeDeck.Bridge.Helm.Part.Sound:play()
		script.Parent.Parent.Parent.Parent:Destroy()
		wait(7)
		local c = game.ServerStorage.warp:Clone()
		c.Parent = game.Workspace
		wait(12)
	if game.Workspace:FindFirstChild("Spacedock") == nil and game.Workspace.BridgeDeck.Bridge.Helm.Part.Value.Value == "Earth Spacedock" then
		if game.Workspace:FindFirstChild("Planet")~= nil then
			game.Workspace.Planet:destroy()
		end
		if game.Workspace:FindFirstChild("Drydock")~= nil then
			game.Workspace.Drydock:destroy()
		end		
		local sd = game.ServerStorage.Spacedock:Clone()
		sd.Parent = game.Workspace
end
	if game.Workspace:FindFirstChild("Planet")== nil and game.Workspace.BridgeDeck.Bridge.Helm.Part.Value.Value == "Planet" then
		if game.Workspace:FindFirstChild("Spacedock")~= nil then
			game.Workspace.Spacedock:destroy()
		end
		if game.Workspace:FindFirstChild("Drydock") ~= nil then
			game.Workspace.Drydock:destroy()
		end
		local p = game.ServerStorage.Planet:Clone()
		p.Parent = game.Workspace
		end
	end
	if game.Workspace:FindFirstChild("Drydock")== nil and game.Workspace.BridgeDeck.Bridge.Helm.Part.Value.Value == "Drydock" then
		if game.Workspace:FindFirstChild("Spacedock")~= nil then
			game.Workspace.Spacedock:destroy()
		end
		if game.Workspace:FindFirstChild("Planet") ~= nil then
			game.Workspace.Planet:destroy()
		end
		local dd = game.ServerStorage.Drydock:Clone()
		dd.Parent = game.Workspace
		end
end
	if game.Workspace.BridgeDeck.Bridge.Helm.Part.Value.Value == "Drydock" then
		if game.Workspace:FindFirstChild("Spacedock")~= nil then
			game.Workspace.Spacedock:destroy()
		end
		if game.Workspace:FindFirstChild("Planet") ~= nil then
			game.Workspace.Planet:destroy()
		end
		if game.Workspace:FindFirstChild("Drydock") ~= nil then
			game.Workspace.Planet:destroy()
	
	else return end
		game.Workspace.Bridge.BridgeDeck.Helm.Sound.Pitch = 5
		game.Workspace.Bridge.BridgeDeck.Helm.Sound:play()
		wait(1.4)
		game.Workspace.warp:destroy()
else
	script.Parent.wrong:Play()
end
end




script.Parent.Parent.Warp.MouseButton1Click:connect(warp)

Can anyone help?

6 comments

0

Could you please explain your goal with your code? What are you trying to do? Where's your error? Some people can figure it out-but it's easier if you provide this kind of information.

0

I've put the goal. And as the title suggests, I don't know what or where the error is.

0

You know, any kind of answer would be good.... well actually, one that fixes it would be better....

0

Try making a bunch of prints throughout the code to see where it stops.

0

I placed a print right after function warp() and it didn't show up in the output. Does this mean there's something wrong with how I;m calling the function?

0

What is script.Parent.Parent.Warp?