Sungmingamerpro13

Truck Teleport (STORY GAME)

Feb 8th, 2025
24
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 2.05 KB | None | 0 0
  1. local Car = game.Workspace.Car1 -- Car1 is the name of your car in workspace.
  2. local Seats = Car.Seats:GetChildren() -- You should have a model called "Seats" in the Car model.
  3. local Gui = script.Parent:FindFirstChild("ExitGui") -- In your CarTP (The part this script is in), you should have a ScreenGui called "ExitGui".
  4. local Gui2 = script.Parent:FindFirstChild("LoadingScreen") -- In your CarTP (The part this script is in), you should have a ScreenGui called "LoadingScreen".
  5. local TeleportService = game:GetService("TeleportService")
  6. local GameId = 0 -- Change to your placeID.
  7. local PlayersInCar = {}
  8. local debounce = false
  9.  
  10. -- You shouldn't have to touch anything below unless you're having bugs.
  11. script.Parent.Touched:Connect(function(hit)
  12.     if debounce then return end
  13.     local player = game.Players:GetPlayerFromCharacter(hit.Parent)
  14.     for i, v in pairs(Seats) do
  15.         if Seats.Occupant == nil then
  16.             local Check = Instance.new("Weld")
  17.             Check.Name = "Check"
  18.             Check.Parent = player.Character
  19.             Check.Parent.Humanoid.JumpPower = 0
  20.             Check.Parent.Humanoid.WalkSpeed = 0
  21.         end
  22.     end
  23.     Gui:Clone().Parent = player.PlayerGui
  24.     Seats[math.random(1, #Seats)]:Sit(player.Character.Humanoid)
  25.     wait(10)
  26.     if player.Character:FindFirstChild("Check") then
  27.         debounce = true
  28.         local Game = TeleportService:ReserveServer(GameId)
  29.         table.insert(PlayersInCar, player)
  30.         if player.PlayerGui:FindFirstChild("ExitGui") then
  31.             player.PlayerGui.ExitGui:Destroy()
  32.         end
  33.         for i = 1, 100 do -- Moves car forward 100 studs.
  34.             Car:TranslateBy(Vector3.new(0, 0, -1))
  35.             wait()
  36.         end
  37.         Gui2:Clone().Parent = player:FindFirstChild("PlayerGui")
  38.         TeleportService:TeleportToPrivateServer(GameId, Game, PlayersInCar)
  39.         wait(10)
  40.         for i = 1, 100 do -- Moves car back.
  41.             Car:TranslateBy(Vector3.new(0, 0, 1))
  42.             wait()
  43.         end
  44.         wait(3)
  45.         debounce = false
  46.     end
  47. end)
Add Comment
Please, Sign In to add comment