I created this lengthy (and quite messy) LOCAL script for a shuttle craft. It makes a sound to simulate takeoff, and changes a decal in front of the window every so often to show it's moving. Then it grabs another shuttle from ReplicatedStorage and teleports you to a brick at the new shuttle. I tried putting it in a regular script, to find that this only works in studio. Here is the code:
repeat wait() until game.Players.LocalPlayer char = game.Players.LocalPlayer.Character destination = game.Workspace.planshut function onClick() script.Parent.Sound:Play() wait(6) script.Parent.Parent.view.Transparency = 0 -- view space wait(1) script.Parent.Parent.view.Decal.Transparency = 0 script.Parent.Parent.view.Decal.Texture = "http://www.roblox.com/asset?id=244339877" --view planet wait(1) script.Parent.Parent.view.Decal.Texture = "http://www.roblox.com/asset?id=244339507" -- closer view wait(1) script.Parent.Parent.view.Decal.Texture = "http://www.roblox.com/asset?id=244339544" -- surface view wait(1) local s = game.ReplicatedStorage.planetshut:clone() s.Parent = game.Workspace -- make shuttle on planet if script.Parent.Parent.Door.Transparency == 0 then s.Door.Transparency = 0 s.Door.CanCollide = true else s.Door.Transparency = 1 s.Door.CanCollide = false end --if door is open, open door on planet shuttle char.Torso.Anchored = true char.Torso.CFrame = destination.CFrame + Vector3.new(0,4,0) wait(0.2) char.Torso.Anchored = false --teleport player to planet shuttle script.Parent.Parent:Destroy() --destroy this shuttle end script.Parent.ClickDetector.MouseClick:connect(onClick)
I can't work out what is wrong! It won't do anything, the output won't tell me anything at all either. Help?