Advertisement
2AreYouMental110

CREATE A CART RIDE (UPDATED)

Jul 15th, 2023 (edited)
3,268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.38 KB | None | 0 0
  1. -- https://www.roblox.com/games/11727501024/UPD-Create-a-Cart-Ride
  2. local up = true -- will move the cart a little up when teleporting, use if cart is glitching through the ground
  3.  
  4.  
  5. print("loading...")
  6. getgenv().clicktotpcacr = false
  7. local Library = loadstring(game:HttpGet("https://raw.githubusercontent.com/xHeptc/Kavo-UI-Library/main/source.lua"))()
  8. local Window = Library.CreateLib("Create A Cart Ride", "Sentinel")
  9. local t1 = Window:NewTab("Main")
  10. local t1s1 = t1:NewSection("Main")
  11. local level
  12. local mouse = game.Players.LocalPlayer:GetMouse()
  13. local ctrldown = false
  14.  
  15. t1s1:NewButton("unlock all levels", "unlock all levels", function()
  16.     for i,v in pairs(workspace.CartRideWorkspace.Objects:GetChildren()) do
  17.         if v.Name == "LevelSpawn" then
  18.             firetouchinterest(game.Players.LocalPlayer.Character.HumanoidRootPart,v.LevelSpawn,0)
  19.         end
  20.     end
  21. end)
  22. t1s1:NewButton("get cart (if there is one)", "get cart", function()
  23.     for i,v in pairs(workspace.CartRideWorkspace.Objects:GetChildren()) do
  24.         if v.Name == "CartGiver" then
  25.             for i,v in pairs(v:GetChildren()) do
  26.                 if v:FindFirstChild("TouchInterest") then
  27.                     firetouchinterest(game.Players.LocalPlayer.Character.HumanoidRootPart,v,0)
  28.                 end
  29.             end
  30.         end
  31.     end
  32. end)
  33. t1s1:NewButton("TP to end", "teleport to end", function()
  34.     local carts = {}
  35.     for i,v in pairs(workspace.CartRideWorkspace.Objects:GetChildren()) do
  36.         if v.Name == "LevelSpawn" then
  37.             carts[v] = tonumber(string.sub(v.LevelSpawn.BBG.TextLabel.Text,string.find(v.LevelSpawn.BBG.TextLabel.Text," ")+1))
  38.         end
  39.     end
  40.     local winnercart = nil
  41.     for i,v in pairs(carts) do
  42.         if winnercart == nil then
  43.             winnercart = {i,v}
  44.         elseif v > winnercart[2] then
  45.             print(v)
  46.             winnercart = {i,v}
  47.         end
  48.     end
  49.     local cf = winnercart[1].LevelSpawn.CFrame
  50.     if up then
  51.         cf = cf + Vector3.new(0,10,0)
  52.     end
  53.     game.Players.LocalPlayer.Character:PivotTo(cf)
  54. end)
  55. t1s1:NewTextBox("level (only number)","level",function(txt)
  56.     level = tonumber(txt)
  57. end)
  58. t1s1:NewButton("TP to level", "teleport to level", function()
  59.     for i,v in pairs(workspace.CartRideWorkspace.Objects:GetChildren()) do
  60.         if v.Name == "LevelSpawn" and tonumber(string.sub(v.LevelSpawn.BBG.TextLabel.Text,string.find(v.LevelSpawn.BBG.TextLabel.Text," ")+1)) == level then
  61.             local cf = v.LevelSpawn.CFrame
  62.             if up then
  63.                 cf = cf + Vector3.new(0,10,0)
  64.             end
  65.             game.Players.LocalPlayer.Character:PivotTo(cf)
  66.         end
  67.     end
  68. end)
  69. game:GetService("UserInputService").InputBegan:Connect(function(input)
  70.     if input.KeyCode == Enum.KeyCode.LeftControl then
  71.         ctrldown = true
  72.     elseif getgenv().clicktotpcacr == true and ctrldown == true and input.UserInputType == Enum.UserInputType.MouseButton1 then
  73.         local cf = mouse.Hit
  74.         if up then
  75.             cf = cf + Vector3.new(0,10,0)
  76.         end
  77.         game.Players.LocalPlayer.Character:PivotTo(cf)
  78.     end
  79. end)
  80. game:GetService("UserInputService").InputEnded:Connect(function(input)
  81.     if input.KeyCode == Enum.KeyCode.LeftControl then
  82.         ctrldown = false
  83.     end
  84. end)
  85. t1s1:NewToggle("ctrl+click to TP","click to teleport",function(bool)
  86.     getgenv().clicktotpcacr = bool
  87. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement