Advertisement
destroyeroftank567

E

Oct 29th, 2022
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.41 KB | None | 0 0
  1. --A-60 😊😊
  2. local speed = 500
  3. local rush = Instance.new("Model", game:GetService("Teams"))
  4. rush.Name = "RushMoving"
  5. game:GetObjects("rbxassetid://11349239279")[1].Parent = rush
  6. rush.monster.Name="RushNew"
  7. rush.RushNew.CanCollide = false
  8. local tweensv = game:GetService("TweenService")
  9. local currentLoadedRoom
  10. local firstLoadedRoom
  11.  
  12. local function setRooms()
  13. local tb = {}
  14. table.foreach(workspace.CurrentRooms:GetChildren(), function(_, r)
  15. if r:FindFirstChild("RoomStart") then
  16. table.insert(tb, tonumber(r.Name))
  17. end
  18. end)
  19. firstLoadedRoom = workspace.CurrentRooms[tostring(math.min(unpack(tb)))]
  20. currentLoadedRoom = workspace.CurrentRooms[tostring(math.max(unpack(tb)) - 1)]
  21. workspace.CurrentRooms.ChildAdded:Connect(function()
  22. local tb = {}
  23. table.foreach(workspace.CurrentRooms:GetChildren(), function(_, r)
  24. if r:FindFirstChild("RoomStart") then
  25. table.insert(tb, tonumber(r.Name))
  26. end
  27. end)
  28. currentLoadedRoom = workspace.CurrentRooms[tostring(math.max(unpack(tb)) - 1)]
  29. end)
  30. end
  31. setRooms()
  32.  
  33. rush.Parent = workspace
  34. rush:MoveTo(firstLoadedRoom.RoomStart.Position + Vector3.new(0, 2, 0))
  35. require(game.ReplicatedStorage.ClientModules.Module_Events).flickerLights(tonumber(currentLoadedRoom.Name), 1)
  36. require(game.ReplicatedStorage.ClientModules.Module_Events).breakLights(firstLoadedRoom)
  37.  
  38. rush.RushNew.Static:Play()
  39. wait(5)
  40. for _, room in pairs(workspace.CurrentRooms:GetChildren()) do
  41. if not room:FindFirstChild("Nodes") then
  42. continue
  43. end
  44. local nodeNum = #room.Nodes:GetChildren()
  45. for _, node, BasePart in pairs(room.Nodes:GetChildren()) do
  46. local timeC = (math.abs((node.Position - rush.RushNew.Position).Magnitude)) / speed
  47. tweensv
  48. :Create(rush.RushNew, TweenInfo.new(timeC, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut), {
  49. CFrame = CFrame.new(node.CFrame.X, node.CFrame.Y + 2, node.CFrame.Z),
  50. })
  51. :Play()
  52. local random = math.random(1, nodeNum)
  53. if tonumber(node.Name) == random then -- first or last node? just choose please
  54. require(game.ReplicatedStorage.ClientModules.Module_Events).breakLights(room)
  55. end
  56. task.wait(timeC)
  57. end
  58. if room == currentLoadedRoom then
  59. task.wait(1)
  60. tweensv
  61. :Create(rush.RushNew, TweenInfo.new(0.5, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut), {
  62. CFrame = CFrame.new(rush.RushNew.CFrame.X, -50, rush.RushNew.CFrame.Z),
  63. })
  64. :Play()
  65. wait(0.5)
  66. rush:Destroy()
  67. end
  68. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement