Advertisement
ExecutorForALLdomain

test

May 31st, 2024 (edited)
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.07 KB | None | 0 0
  1. local plrr = game.Players.LocalPlayer.Name
  2. print("guh")
  3. local PL = {
  4. "Lava",
  5. "Part",
  6. "Head",
  7. "Spin Part",
  8. "Spin Lava",
  9. "Ramp",
  10. "Torus",
  11. "Truss"
  12. }
  13.  
  14. local function addpart()
  15. local B = math.random(1 , 6)
  16.  
  17. if 2 < B then
  18.  
  19. local Selected = math.random(1, #PL)
  20. Selected = PL[Selected]
  21. game:GetService("ReplicatedStorage").Events.AddObject:InvokeServer(Selected, workspace.Obbies[plrr].Area.CFrame)
  22.  
  23. end
  24. end
  25.  
  26. local function randomizeCFrame(cf)
  27. local axes = {"X", "Z"}
  28. local axis = axes[math.random(1, #axes)]
  29.  
  30. local move = math.random(0, 3)
  31. local direction = math.random(0, 1) == 1 and 1 or -1
  32. local distance = math.random(2, 20)
  33.  
  34. if move > 0 then
  35. if axis == "X" then
  36. cf = cf * CFrame.new(direction * distance, 0, 0)
  37. elseif axis == "Z" then
  38. cf = cf * CFrame.new(0, 0, direction * distance)
  39. end
  40. end
  41.  
  42. print(cf)
  43. return cf
  44. end
  45.  
  46. while wait() do --game:GetService("ReplicatedStorage").Events.AddObject:InvokeServer("Slow Ramp Track", RampPos)
  47. game:GetService("ReplicatedStorage"):WaitForChild("Events"):WaitForChild("UpdateButton"):FireServer(workspace.Obbies[plrr].Items.Buttons:WaitForChild("Button"), {
  48. [1] = workspace.Obbies[plrr].Items.Special:WaitForChild("Slow Ramp Track")["Slow Ramp Track"]
  49. })
  50.  
  51. local RampPos = workspace.Obbies[plrr].Items.Special:WaitForChild("Slow Ramp Track")["Slow Ramp Track"].CFrame
  52.  
  53. task.wait( math.random( 1, 1.5 ) )
  54.  
  55.  
  56. game:GetService("ReplicatedStorage"):WaitForChild("Events"):WaitForChild("DeleteObject"):InvokeServer({
  57. [1] = workspace.Obbies[plrr].Items.Special:WaitForChild("Slow Ramp Track")["Slow Ramp Track"]:WaitForChild("Buttons"),
  58. [2] = workspace.Obbies[plrr].Items.Special:WaitForChild("Slow Ramp Track")["Slow Ramp Track"]
  59. })
  60.  
  61. task.wait(math.random(0.1, 0.5))
  62.  
  63. RampPos = randomizeCFrame(RampPos)
  64.  
  65. game:GetService("ReplicatedStorage").Events.AddObject:InvokeServer("Slow Ramp Track", RampPos)
  66.  
  67.  
  68. if not workspace.Obbies[plrr].Items.Special:FindFirstChild("Slow Ramp Track")["Slow Ramp Track"] then
  69.  
  70. game:GetService("ReplicatedStorage").Events.AddObject:InvokeServer("Slow Ramp Track", RampPos)
  71.  
  72. end
  73. addpart()
  74. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement