Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -------CREDITS--------------CREDITS--------------CREDITS--------------CREDITS-------
- --[[
- ███╗░░░███╗░█████╗░██████╗░███████╗ ██████╗░██╗░░░██╗
- ████╗░████║██╔══██╗██╔══██╗██╔════╝ ██╔══██╗╚██╗░██╔╝
- ██╔████╔██║███████║██║░░██║█████╗░░ ██████╦╝░╚████╔╝░
- ██║╚██╔╝██║██╔══██║██║░░██║██╔══╝░░ ██╔══██╗░░╚██╔╝░░
- ██║░╚═╝░██║██║░░██║██████╔╝███████╗ ██████╦╝░░░██║░░░
- ╚═╝░░░░░╚═╝╚═╝░░╚═╝╚═════╝░╚══════╝ ╚═════╝░░░░╚═╝░░░
- ███████╗██████╗░██╗░░██╗████████╗██╗██╗░░██╗██╗░░░██╗██╗
- ██╔════╝██╔══██╗██║░██╔╝╚══██╔══╝██║██║░██╔╝╚██╗░██╔╝██║
- █████╗░░██████╔╝█████═╝░░░░██║░░░██║█████═╝░░╚████╔╝░██║
- ██╔══╝░░██╔══██╗██╔═██╗░░░░██║░░░██║██╔═██╗░░░╚██╔╝░░╚═╝
- ███████╗██║░░██║██║░╚██╗░░░██║░░░██║██║░╚██╗░░░██║░░░██╗
- ╚══════╝╚═╝░░╚═╝╚═╝░░╚═╝░░░╚═╝░░░╚═╝╚═╝░░╚═╝░░░╚═╝░░░╚═╝
- --]]
- -----TUTORIAL----------TUTORIAL----------TUTORIAL----------TUTORIAL-----
- --[[
- Once the part spawns, you need to touch the thin part in the middle of the base.
- Then your character will be locked and you will be able to control the part with WASD.
- You can also go up with E and go down with Q.
- Once you want to exit the seat press spacebar.
- You can also stand on the part, it's just transparent.
- --]]
- if game.Workspace:FindFirstChild(game.Players.LocalPlayer.Name) then
- task.wait()
- local UIS = game:GetService("UserInputService")
- local part = Instance.new("Part")
- part.Position = game.Players.LocalPlayer.Character.Head.Position - Vector3.new(0,3,0)
- part.Anchored = true
- part.Parent = workspace
- part.Name = "FlyingPart"
- part.Size = Vector3.new(10,1,10)
- part.Material = Enum.Material.ForceField
- part.FrontSurface = Enum.SurfaceType.Hinge
- local seat = Instance.new("Seat")
- seat.Parent = part
- seat.Size = Vector3.new(0.1,1.5,0.1)
- seat.Position = part.Position + Vector3.new(0,1.25,0)
- seat.Transparency = 0.1
- local seatbox = Instance.new("SelectionBox")
- seatbox.Parent = seat
- seatbox.Adornee = seat
- seatbox.LineThickness = 0.05
- seatbox.Color3 = Color3.fromRGB(255,255,255)
- local box = Instance.new("SelectionBox")
- box.Parent = part
- box.Adornee = part
- box.LineThickness = 0.05
- box.Color3 = Color3.fromRGB(255,255,255)
- local weld = Instance.new("Weld")
- weld.Parent = part
- weld.Name = "SeatWeld"
- weld.Part0 = part
- weld.Part1 = seat
- local seated = false
- seat.Touched:Connect(function(hit)
- if seated == false then
- if hit.Parent:FindFirstChild("Humanoid") then
- seated = true
- local playerWeld = Instance.new("WeldConstraint")
- playerWeld.Parent = seat
- playerWeld.Part0 = seat
- playerWeld.Part1 = game.Players.LocalPlayer.Character.HumanoidRootPart
- UIS.InputBegan:Connect(function(input)
- if input.KeyCode == Enum.KeyCode.Space then
- playerWeld:Destroy()
- seated = false
- end
- end)
- end
- end
- end)
- UIS.InputBegan:Connect(function(input)
- if seated == true then
- if input.KeyCode == Enum.KeyCode.W then
- while UIS:IsKeyDown(Enum.KeyCode.W) do
- part.CFrame = part.CFrame + (part.CFrame.LookVector*0.7)
- task.wait()
- end
- elseif input.KeyCode == Enum.KeyCode.A then
- while UIS:IsKeyDown(Enum.KeyCode.A) do
- part.Orientation = part.Orientation + Vector3.new(0,2,0)
- task.wait()
- end
- elseif input.KeyCode == Enum.KeyCode.S then
- while UIS:IsKeyDown(Enum.KeyCode.S) do
- part.CFrame = part.CFrame - (part.CFrame.LookVector*0.7)
- task.wait()
- end
- elseif input.KeyCode == Enum.KeyCode.D then
- while UIS:IsKeyDown(Enum.KeyCode.D) do
- part.Orientation = part.Orientation - Vector3.new(0,2,0)
- task.wait()
- end
- elseif input.KeyCode == Enum.KeyCode.E then
- while UIS:IsKeyDown(Enum.KeyCode.E) do
- part.CFrame = part.CFrame + (part.CFrame.UpVector*0.4)
- task.wait()
- end
- elseif input.KeyCode == Enum.KeyCode.Q then
- while UIS:IsKeyDown(Enum.KeyCode.Q) do
- part.CFrame = part.CFrame + (-part.CFrame.UpVector*0.4)
- task.wait()
- end
- end
- end
- end)
- else
- game.Players.LocalPlayer.CharacterAdded:Connect(function()
- task.wait(3)
- local UIS = game:GetService("UserInputService")
- local part = Instance.new("Part")
- part.Position = game.Players.LocalPlayer.Character.Head.Position - Vector3.new(0,3,0)
- part.Anchored = true
- part.Parent = workspace
- part.Name = "FlyingPart"
- part.Size = Vector3.new(10,1,10)
- part.Material = Enum.Material.ForceField
- part.FrontSurface = Enum.SurfaceType.Hinge
- local seat = Instance.new("Seat")
- seat.Parent = part
- seat.Size = Vector3.new(0.1,1.5,0.1)
- seat.Position = part.Position + Vector3.new(0,1.25,0)
- seat.Transparency = 0.1
- local seatbox = Instance.new("SelectionBox")
- seatbox.Parent = seat
- seatbox.Adornee = seat
- seatbox.LineThickness = 0.05
- seatbox.Color3 = Color3.fromRGB(255,255,255)
- local box = Instance.new("SelectionBox")
- box.Parent = part
- box.Adornee = part
- box.LineThickness = 0.05
- box.Color3 = Color3.fromRGB(255,255,255)
- local weld = Instance.new("Weld")
- weld.Parent = part
- weld.Name = "SeatWeld"
- weld.Part0 = part
- weld.Part1 = seat
- local seated = false
- seat.Touched:Connect(function(hit)
- if seated == false then
- if hit.Parent:FindFirstChild("Humanoid") then
- seated = true
- local playerWeld = Instance.new("WeldConstraint")
- playerWeld.Parent = seat
- playerWeld.Part0 = seat
- playerWeld.Part1 = game.Players.LocalPlayer.Character.HumanoidRootPart
- UIS.InputBegan:Connect(function(input)
- if input.KeyCode == Enum.KeyCode.Space then
- playerWeld:Destroy()
- seated = false
- end
- end)
- end
- end
- end)
- UIS.InputBegan:Connect(function(input)
- if seated == true then
- if input.KeyCode == Enum.KeyCode.W then
- while UIS:IsKeyDown(Enum.KeyCode.W) do
- part.CFrame = part.CFrame + (part.CFrame.LookVector*0.7)
- task.wait()
- end
- elseif input.KeyCode == Enum.KeyCode.A then
- while UIS:IsKeyDown(Enum.KeyCode.A) do
- part.Orientation = part.Orientation + Vector3.new(0,2,0)
- task.wait()
- end
- elseif input.KeyCode == Enum.KeyCode.S then
- while UIS:IsKeyDown(Enum.KeyCode.S) do
- part.CFrame = part.CFrame - (part.CFrame.LookVector*0.7)
- task.wait()
- end
- elseif input.KeyCode == Enum.KeyCode.D then
- while UIS:IsKeyDown(Enum.KeyCode.D) do
- part.Orientation = part.Orientation - Vector3.new(0,2,0)
- task.wait()
- end
- elseif input.KeyCode == Enum.KeyCode.E then
- while UIS:IsKeyDown(Enum.KeyCode.E) do
- part.CFrame = part.CFrame + (part.CFrame.UpVector*0.4)
- task.wait()
- end
- elseif input.KeyCode == Enum.KeyCode.Q then
- while UIS:IsKeyDown(Enum.KeyCode.Q) do
- part.CFrame = part.CFrame + (-part.CFrame.UpVector*0.4)
- task.wait()
- end
- end
- end
- end)
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement