Advertisement
ThxirdyySharvxkyy

Create A Cart Ride Level Teleporter

Jul 11th, 2023
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.29 KB | None | 0 0
  1. -- Variables:
  2. local Players = game:GetService("Players")
  3. local player = Players.LocalPlayer
  4.  
  5. -- Instances:
  6.  
  7. local CreateACartRideTpLvlGui = Instance.new("ScreenGui")
  8. local main = Instance.new("Frame")
  9. local title = Instance.new("TextLabel")
  10. local desc1 = Instance.new("TextLabel")
  11. local desc2 = Instance.new("TextLabel")
  12. local LevelInserter = Instance.new("TextBox")
  13. local UICorner = Instance.new("UICorner")
  14. local tptolvl = Instance.new("TextButton")
  15. local UICorner_2 = Instance.new("UICorner")
  16.  
  17. --Properties:
  18.  
  19. CreateACartRideTpLvlGui.Name = "CreateACartRideTpLvlGui"
  20. CreateACartRideTpLvlGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  21. CreateACartRideTpLvlGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  22. CreateACartRideTpLvlGui.ResetOnSpawn = false
  23.  
  24. main.Name = "main"
  25. main.Parent = CreateACartRideTpLvlGui
  26. main.BackgroundColor3 = Color3.fromRGB(47, 47, 47)
  27. main.BorderColor3 = Color3.fromRGB(0, 0, 0)
  28. main.BorderSizePixel = 0
  29. main.Position = UDim2.new(0.333033323, 0, 0.102296457, 0)
  30. main.Size = UDim2.new(0.333033293, 0, 0.793319404, 0)
  31. main.Selectable = true
  32. main.Active = true
  33. main.Draggable = true
  34.  
  35. title.Name = "title"
  36. title.Parent = main
  37. title.BackgroundColor3 = Color3.fromRGB(87, 87, 87)
  38. title.BorderColor3 = Color3.fromRGB(0, 0, 0)
  39. title.BorderSizePixel = 0
  40. title.Size = UDim2.new(1, 0, 0.114593297, 0)
  41. title.Font = Enum.Font.Gotham
  42. title.Text = "Create A Cart Ride Level Teleporter"
  43. title.TextColor3 = Color3.fromRGB(255, 255, 255)
  44. title.TextScaled = true
  45. title.TextSize = 14.000
  46. title.TextWrapped = true
  47.  
  48. desc1.Name = "desc1"
  49. desc1.Parent = main
  50. desc1.BackgroundColor3 = Color3.fromRGB(87, 87, 87)
  51. desc1.BorderColor3 = Color3.fromRGB(0, 0, 0)
  52. desc1.BorderSizePixel = 0
  53. desc1.Position = UDim2.new(0, 0, 0.114593297, 0)
  54. desc1.Size = UDim2.new(1, 0, 0.114593297, 0)
  55. desc1.Font = Enum.Font.Gotham
  56. desc1.Text = "type the level you want to be teleported to on the textbox below (you can teleport others by making them sit in your cart and teleporting to the level you want to teleport)"
  57. desc1.TextColor3 = Color3.fromRGB(255, 255, 255)
  58. desc1.TextScaled = true
  59. desc1.TextSize = 14.000
  60. desc1.TextWrapped = true
  61.  
  62. desc2.Name = "desc2"
  63. desc2.Parent = main
  64. desc2.BackgroundColor3 = Color3.fromRGB(87, 87, 87)
  65. desc2.BorderColor3 = Color3.fromRGB(0, 0, 0)
  66. desc2.BorderSizePixel = 0
  67. desc2.Position = UDim2.new(0, 0, 0.229186594, 0)
  68. desc2.Size = UDim2.new(1, 0, 0.114593297, 0)
  69. desc2.Font = Enum.Font.Gotham
  70. desc2.Text = "You dont have to put something like \"Level 10\" instead, just put \"10\" on the textbox"
  71. desc2.TextColor3 = Color3.fromRGB(255, 255, 255)
  72. desc2.TextScaled = true
  73. desc2.TextSize = 14.000
  74. desc2.TextWrapped = true
  75.  
  76. LevelInserter.Name = "LevelInserter"
  77. LevelInserter.Parent = main
  78. LevelInserter.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  79. LevelInserter.BorderColor3 = Color3.fromRGB(0, 0, 0)
  80. LevelInserter.BorderSizePixel = 0
  81. LevelInserter.Position = UDim2.new(0.0513513498, 0, 0.41941148, 0)
  82. LevelInserter.Size = UDim2.new(0.878378391, 0, 0.233770326, 0)
  83. LevelInserter.ClearTextOnFocus = false
  84. LevelInserter.Font = Enum.Font.Gotham
  85. LevelInserter.PlaceholderColor3 = Color3.fromRGB(0, 0, 0)
  86. LevelInserter.PlaceholderText = "Put level here"
  87. LevelInserter.Text = ""
  88. LevelInserter.TextColor3 = Color3.fromRGB(0, 0, 0)
  89. LevelInserter.TextScaled = true
  90. LevelInserter.TextSize = 14.000
  91. LevelInserter.TextWrapped = true
  92.  
  93. UICorner.Parent = LevelInserter
  94.  
  95. tptolvl.Name = "tptolvl"
  96. tptolvl.Parent = main
  97. tptolvl.BackgroundColor3 = Color3.fromRGB(87, 87, 87)
  98. tptolvl.BorderColor3 = Color3.fromRGB(0, 0, 0)
  99. tptolvl.BorderSizePixel = 0
  100. tptolvl.Position = UDim2.new(0.12702702, 0, 0.721937776, 0)
  101. tptolvl.Size = UDim2.new(0.724324346, 0, 0.190224871, 0)
  102. tptolvl.Font = Enum.Font.Gotham
  103. tptolvl.Text = "Teleport to requested level"
  104. tptolvl.TextColor3 = Color3.fromRGB(255, 255, 255)
  105. tptolvl.TextScaled = true
  106. tptolvl.TextSize = 14.000
  107. tptolvl.TextWrapped = true
  108.  
  109. UICorner_2.Parent = tptolvl
  110.  
  111. tptolvl.MouseButton1Click:Connect(function()
  112. for i, object in pairs(workspace.CartRideWorkspace.Objects:GetChildren()) do
  113. if object:IsA("Model") then
  114. if object.Name == "LevelSpawn" then
  115. if object.LevelSpawn.BBG.TextLabel.Text == "Level "..LevelInserter.Text then
  116. player.Character:PivotTo(object.LevelSpawn.CFrame)
  117. end
  118. end
  119. end
  120. end
  121. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement