Advertisement
Guest User

Untitled

a guest
Mar 7th, 2021
844
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 14.76 KB | None | 0 0
  1. --[[ OPE OPE NO MI Created By: RB_Nostalgia
  2. First Move: Room
  3. Second Move: Shambles
  4. Third Move: Takt]]--
  5.  
  6. -- // SERVICES
  7. local REPLICATED_STORAGE = game:GetService("ReplicatedStorage")
  8. local USER_INPUT_SERVICE = game:GetService("UserInputService")
  9. local TWEEN_SERVICE = game:GetService("TweenService")
  10. local DEBRIS_SERVICE = game:GetService("Debris")
  11.  
  12. -- // VARIABLES
  13. local InsideRoom = false
  14. local mouseMod = require(script:WaitForChild("Mouse"))
  15. local cutEvent = game.ReplicatedStorage.DFS.Ope:WaitForChild("Cut")
  16. local mouse1 = mouseMod:New()
  17. local ROOMTIME = nil
  18. local TOOLENABLED = false
  19. local HOLDTIME = nil
  20. local DEBOUNCE = false
  21. local DEBOUNCE2 = false
  22. local ROOMCOOLDOWN = 15
  23. local CANCELLCOOLDOWN = 3.5
  24. local LocalPlayer = game.Players.LocalPlayer
  25. repeat wait() until LocalPlayer.Character
  26. local Character = LocalPlayer.Character
  27. local Humanoid = Character:WaitForChild("Humanoid")
  28. local Animator = Humanoid:WaitForChild("Animator")
  29. local mouse = LocalPlayer:GetMouse()
  30. local ActivateRoom = REPLICATED_STORAGE.DFS.Ope:WaitForChild("ActivateRoom")
  31. local RoomCreation = REPLICATED_STORAGE.DFS.Ope:WaitForChild("RoomCreation")
  32. local RoomPart = REPLICATED_STORAGE.DFS.Ope:WaitForChild("Room_Part")
  33. local RoomActivationAnim = REPLICATED_STORAGE.DFS.Ope.Animations:WaitForChild("Room_Anim")
  34. local RoomExpansion = REPLICATED_STORAGE.DFS.Ope:WaitForChild("RoomExpansion")
  35. local BlueRing = REPLICATED_STORAGE.DFS.Ope:WaitForChild("BlueRing")
  36. local SmokeRing = REPLICATED_STORAGE.DFS.Ope:WaitForChild("SmokeRing")
  37. local ShamblesActivationEvent = REPLICATED_STORAGE.DFS.Ope:WaitForChild("ActivateShambles")
  38. local Shambles = REPLICATED_STORAGE.DFS.Ope:WaitForChild("Shambles")
  39. local ROOMCOMPLETED = false
  40. local SHAMBLESCOOLDOWN = 2
  41. local TAKTCOOLDOWN = 2
  42. local SHAMBLESENABLED = true
  43. local TAKTENABLED = true
  44. local TaktCreateEvent = REPLICATED_STORAGE.DFS.Ope:WaitForChild("TaktCreate")
  45. local TaktThrowEvent = REPLICATED_STORAGE.DFS.Ope:WaitForChild("TaktThrow")
  46. local list = {game.Workspace.FX:GetDescendants(), game.Workspace.Baseplate}
  47. local TaktRock = REPLICATED_STORAGE.DFS.Ope:WaitForChild("TaktRock")
  48.  
  49. local x,y,z = 15,15,15
  50. local x1,y1,z1 = 0.158, 1.605, 1.605
  51. local x2,y2,z2 = 0.3, 0.3, 0.3
  52.  
  53. local FirstRoomTweenInfo = TweenInfo.new(
  54.     .5,
  55.     Enum.EasingStyle.Back,
  56.     Enum.EasingDirection.Out,
  57.     0,
  58.     false,
  59.     0
  60. )
  61.  
  62. local FirstRoomTweenGoals = {
  63.     Scale = Vector3.new(0.3, 0.3, 0.3)
  64. }
  65.  
  66. local SecondRoomTweenInfo = TweenInfo.new(
  67.     .5,
  68.     Enum.EasingStyle.Back,
  69.     Enum.EasingDirection.Out,
  70.     0,
  71.     false,
  72.     0  
  73. )
  74.  
  75.  
  76. local CancelRoomTweenInfo = TweenInfo.new(
  77.     .5,
  78.     Enum.EasingStyle.Back,
  79.     Enum.EasingDirection.In,
  80.     0,
  81.     false,
  82.     0  
  83. )
  84. local CancelRoomTweenGoals = {
  85.     Scale = Vector3.new(0, 0, 0)
  86. }
  87.  
  88. local BlueRingTweenInfo = TweenInfo.new(
  89.     .3,
  90.     Enum.EasingStyle.Linear,
  91.     Enum.EasingDirection.Out,
  92.     0,
  93.     false,
  94.     0  
  95. )
  96.  
  97. local BlueRingTransparencyTweenInfo = TweenInfo.new(
  98.     1,
  99.     Enum.EasingStyle.Linear,
  100.     Enum.EasingDirection.In,
  101.     0,
  102.     false,
  103.     0  
  104. )
  105.  
  106. local SmokeRingTweenInfo = TweenInfo.new(
  107.     .3,
  108.     Enum.EasingStyle.Back,
  109.     Enum.EasingDirection.Out,
  110.     0,
  111.     false,
  112.     0  
  113. )
  114.  
  115. local SmokeRingExpandTweenInfo = TweenInfo.new(
  116.     .4,
  117.     Enum.EasingStyle.Back,
  118.     Enum.EasingDirection.Out,
  119.     0,
  120.     false,
  121.     0  
  122. )
  123.  
  124. local SmokeRingTransparencyTweenInfo = TweenInfo.new(
  125.     1.2,
  126.     Enum.EasingStyle.Linear,
  127.     Enum.EasingDirection.Out,
  128.     0,
  129.     false,
  130.     .6 
  131. )
  132.  
  133. -- // EVENTS
  134.  
  135. script.Parent.Equipped:Connect(function()
  136.     TOOLENABLED = true
  137. end)
  138.  
  139. script.Parent.Unequipped:Connect(function()
  140.     TOOLENABLED = false
  141. end)
  142.  
  143.  
  144. USER_INPUT_SERVICE.InputBegan:Connect(function(input, GPE)
  145.     if GPE then return end
  146.  
  147.     if input.KeyCode == Enum.KeyCode.Q then
  148.         if TOOLENABLED == true then
  149.             if DEBOUNCE == false then
  150.                 DEBOUNCE = true
  151.                 local RoomActivationAnimTrack = LocalPlayer.Character:FindFirstChild("Humanoid"):LoadAnimation(RoomActivationAnim)
  152.                 RoomActivationAnimTrack:Play()
  153.                 HOLDTIME = os.clock()
  154.                 RoomActivationAnimTrack:GetMarkerReachedSignal("HoldEvent"):Connect(function()
  155.                     RoomActivationAnimTrack:AdjustSpeed(0)
  156.                     Character.HumanoidRootPart.Anchored = true
  157.                     Humanoid.WalkSpeed = 0
  158.                     ActivateRoom:FireServer("Create")
  159.                 end)
  160.             end
  161.         end
  162.     end
  163. end)
  164.  
  165. USER_INPUT_SERVICE.InputEnded:Connect(function(input, GPE)
  166.     if GPE then return end
  167.  
  168.     if input.KeyCode == Enum.KeyCode.Q then
  169.         local UNPRESSTIME = os.clock()
  170.         if TOOLENABLED == true then
  171.             if DEBOUNCE == true then
  172.                 if DEBOUNCE2 == false then
  173.                     if UNPRESSTIME - HOLDTIME >= 1.5 then
  174.                         DEBOUNCE2 = true
  175.                         ROOMTIME = (UNPRESSTIME - HOLDTIME) * 5
  176.                         local TimeHeld = 0
  177.                         if UNPRESSTIME - HOLDTIME > 10 then
  178.                             TimeHeld = 65
  179.                         else
  180.                             TimeHeld = (UNPRESSTIME - HOLDTIME)^2
  181.                         end
  182.                         ROOMCOOLDOWN = ROOMCOOLDOWN + TimeHeld
  183.                         x, y, z = x + TimeHeld, y + TimeHeld, z + TimeHeld
  184.                         x1, y1, z1 = x * 4.2, 0.063, z * 4.2
  185.                         x2, y2, z2 = x * 4, y * 4, z * 1.2
  186.                         local AnimationTracks = Animator:GetPlayingAnimationTracks()
  187.                         ActivateRoom:FireServer("Expand", x, y, z, x1, y1, z1, x2, y2, z2, ROOMTIME)
  188.                         for i, tracks in pairs(AnimationTracks) do
  189.                             tracks:AdjustSpeed(1)
  190.                         end
  191.                         Humanoid.WalkSpeed = 16
  192.                         Character.HumanoidRootPart.Anchored = false
  193.                         wait(ROOMCOOLDOWN)
  194.                         DEBOUNCE2 = false
  195.                         DEBOUNCE = false
  196.                         print("Off_Cooldown")
  197.                     elseif UNPRESSTIME - HOLDTIME > 0.1  and UNPRESSTIME - HOLDTIME < 1.5 then
  198.                         DEBOUNCE2 = true
  199.                         local RoomPart = game.Workspace.FX.Room_Part
  200.                         local CancelRoomTween = TWEEN_SERVICE:Create(RoomPart.Mesh, CancelRoomTweenInfo, CancelRoomTweenGoals)
  201.                         CancelRoomTween:Play()
  202.                         wait(.6)
  203.                         RoomPart:Destroy()
  204.                         local AnimationTracks = Animator:GetPlayingAnimationTracks()
  205.                         for i, tracks in pairs(AnimationTracks) do
  206.                             tracks:AdjustSpeed(1)
  207.                         end
  208.                         Humanoid.WalkSpeed = 16
  209.                         Character.HumanoidRootPart.Anchored = false
  210.                         wait(ROOMCOOLDOWN)
  211.                         DEBOUNCE2 = false
  212.                         DEBOUNCE = false
  213.                         print("OffCooldown")
  214.                     end
  215.                 end
  216.             end
  217.         end
  218.     end
  219. end)
  220.  
  221. USER_INPUT_SERVICE.InputBegan:Connect(function(input, GPE)
  222.     if GPE then return end
  223.     if input.KeyCode == Enum.KeyCode.E then
  224.         if TOOLENABLED == true then
  225.             if game.Workspace.FX:FindFirstChild("Room_Part") then
  226.                 if ROOMCOMPLETED == true then
  227.                     if SHAMBLESENABLED == true then
  228.                         SHAMBLESENABLED = false
  229.                         local mouseTarget = mouse.Target
  230.                         ShamblesActivationEvent:FireServer(mouseTarget)
  231.                         if mouseTarget:IsA("MeshPart") or mouseTarget:IsA("BasePart") and mouseTarget.Parent:FindFirstChild("Humanoid") == true then
  232.                             wait(SHAMBLESCOOLDOWN)
  233.                         else
  234.                             return
  235.                         end
  236.                         SHAMBLESENABLED = true                     
  237.                     end
  238.                 end
  239.             end
  240.         end
  241.     end
  242. end)
  243.  
  244. USER_INPUT_SERVICE.InputBegan:Connect(function(input, GPE)
  245.     if GPE then return end
  246.     if input.KeyCode == Enum.KeyCode.R then
  247.         if TOOLENABLED == true then
  248.             if game.Workspace.FX:FindFirstChild("Room_Part") then
  249.                 if ROOMCOMPLETED == true then
  250.                     if TAKTENABLED == true then
  251.                         TAKTENABLED = false
  252.                         local mouseLocation = mouse.Hit.p
  253.                         TaktCreateEvent:FireServer(mouseLocation, "Create")                
  254.                     end
  255.                 end
  256.             end
  257.         end
  258.     end
  259. end)
  260.  
  261. USER_INPUT_SERVICE.InputBegan:Connect(function(input, GPE)
  262.     if GPE then return end
  263.     if input.KeyCode == Enum.KeyCode.R then
  264.         if TOOLENABLED == true then
  265.             if game.Workspace.FX:FindFirstChild("Room_Part") then
  266.                 if ROOMCOMPLETED == true then
  267.                     if TAKTENABLED == false then
  268.                         TAKTENABLED = true
  269.                         local mouseLocation = mouse.Hit.p
  270.                         TaktCreateEvent:FireServer(mouseLocation, "Expand")                
  271.                     end
  272.                 end
  273.             end
  274.         end
  275.     end
  276. end)
  277.  
  278.  
  279.  
  280.  
  281. RoomCreation.OnClientEvent:Connect(function(Player,Word) -- THIS IS WHERE THE ROOM IS MADE IN THE HAND
  282.     Player.Character.Humanoid:SetAttribute("RoomEnabled", true)
  283.     local RoomClone = RoomPart:Clone()
  284.     local SmokeRingClone = SmokeRing:Clone()
  285.     local HitBox = Instance.new("Part")
  286.     HitBox.Shape = Enum.PartType.Ball
  287.     HitBox.Transparency = 1
  288.     HitBox.Name = "RoomHitBox"
  289.     HitBox.Anchored = true
  290.     HitBox.CanCollide = false
  291.     HitBox.CastShadow = false
  292.     SmokeRingClone.Parent = game.Workspace.FX
  293.     RoomClone.Parent = game.Workspace.FX
  294.     HitBox.Parent = game.Workspace.FX
  295.     local RingClone = BlueRing:Clone()
  296.     RingClone.Parent = game.Workspace.FX
  297.     RingClone.CFrame = Player.Character.HumanoidRootPart.CFrame * CFrame.new(0,-3,0)
  298.     RingClone.CFrame = RingClone.CFrame * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0))
  299.     HitBox.Size = RoomClone.Mesh.Scale + Vector3.new(3.9,3.9,3.9)
  300.     local RightHand = Player.Character.RightHand
  301.     RoomClone.CFrame = RightHand.CFrame + (RightHand.CFrame.upVector * -1)
  302.     HitBox.CFrame = RoomClone.CFrame
  303.     SmokeRingClone.CFrame = RoomClone.CFrame
  304.     SmokeRingClone.CFrame = CFrame.new(RoomClone.Position) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(0))
  305.     local SmokeRingTweenGoals = {
  306.         Scale = Vector3.new(1.3, 1.3, 1.3)
  307.     }
  308.     local HitBoxTweenGoals = {
  309.         Size = Vector3.new(1.3*3.9, 1.3*3.9, 1.3*3.9)
  310.     }
  311.     local FirstRoomTween = TWEEN_SERVICE:Create(RoomClone.Mesh,FirstRoomTweenInfo, FirstRoomTweenGoals)
  312.     local SmokeRingTween = TWEEN_SERVICE:Create(SmokeRingClone.Mesh, SmokeRingTweenInfo, SmokeRingTweenGoals)
  313.     local FirstHitBoxTween = TWEEN_SERVICE:Create(HitBox, FirstRoomTweenInfo, HitBoxTweenGoals)
  314.     SmokeRingTween:Play()
  315.     FirstRoomTween:Play()
  316.     FirstHitBoxTween:Play()
  317. end)
  318.  
  319.  
  320. RoomExpansion.OnClientEvent:Connect(function(Player, Word, x, y, z, x1, y1, z1, x2, y2, z2, ROOMTIME)
  321.     local HitBox = game.Workspace.FX:WaitForChild("RoomHitBox")
  322.     local RoomClone = game.Workspace.FX:WaitForChild("Room_Part")
  323.     local SmokeRingClone = game.Workspace.FX:WaitForChild("SmokeRing")
  324.     local RingClone = game.Workspace.FX:WaitForChild("BlueRing")
  325.     RingClone.Transparency = 0
  326.     local SecondRoomTweenGoals = {
  327.         Scale = Vector3.new(x, y, z)
  328.     }
  329.     local BlueRingTweenGoals = {
  330.         Size = Vector3.new(x1, y1, z1),
  331.     }
  332.     local BlueRingTransparencyTweenGoals = {
  333.         Transparency = 1
  334.     }
  335.     local SmokeRingExpandTweenGoals = {
  336.         Scale = Vector3.new(x2, y2, z2)
  337.     }
  338.     local SmokeRingTransparencyTweenGoals = {
  339.         Transparency = 1
  340.     }
  341.     local HitBoxExpandTweenGoals = {
  342.         Size = Vector3.new(x*3.9, y*3.9, z*3.9)
  343.     }
  344.  
  345.     local SecondRoomTween = TWEEN_SERVICE:Create(RoomClone.Mesh, SecondRoomTweenInfo, SecondRoomTweenGoals)
  346.     local HitBoxExpandTween = TWEEN_SERVICE:Create(HitBox, SecondRoomTweenInfo, HitBoxExpandTweenGoals)
  347.     RoomClone.CFrame = Player.Character.HumanoidRootPart.CFrame
  348.     HitBox.CFrame = RoomClone.CFrame
  349.     local BlueRingTween = TWEEN_SERVICE:Create(RingClone, BlueRingTweenInfo, BlueRingTweenGoals)
  350.     local BlueRingTransparencyTween = TWEEN_SERVICE:Create(RingClone, BlueRingTransparencyTweenInfo, BlueRingTransparencyTweenGoals)
  351.     local SmokeRingExpandTween = TWEEN_SERVICE:Create(SmokeRingClone.Mesh, SmokeRingExpandTweenInfo, SmokeRingExpandTweenGoals)
  352.     local SmokeRingTransparencyTween = TWEEN_SERVICE:Create(SmokeRingClone, SmokeRingTransparencyTweenInfo, SmokeRingTransparencyTweenGoals)
  353.     BlueRingTween:Play()
  354.     BlueRingTransparencyTween:Play()
  355.     SmokeRingExpandTween:Play()
  356.     SecondRoomTween:Play()
  357.     HitBoxExpandTween:Play()
  358.     SmokeRingTransparencyTween:Play()
  359.     HitBoxExpandTween.Completed:Connect(function()
  360.         ROOMCOMPLETED = true
  361.         local pos1 = HitBox.Position - (HitBox.Size / 2)
  362.         local pos2 = HitBox.Position + (HitBox.Size / 2)
  363.         local region3 = Region3.new(pos1,pos2)
  364.         while RoomClone.Parent ~= nil do
  365.             wait()
  366.             local deb = false
  367.             local partsInRegion = game.Workspace:FindPartsInRegion3(region3, Player.Character, math.huge)
  368.             if deb == false then
  369.                 deb = true
  370.                 for i, parts in pairs(partsInRegion) do
  371.                     if parts.Parent:FindFirstChild("Humanoid") then
  372.                         print(parts.Parent.Name)
  373.                         return
  374.                     end
  375.                 end        
  376.             end
  377.         end
  378.     end)
  379.     DEBRIS_SERVICE:AddItem(RoomClone, ROOMTIME)
  380.     DEBRIS_SERVICE:AddItem(SmokeRingClone, 4)
  381.     DEBRIS_SERVICE:AddItem(RingClone, 2)
  382.     RoomClone.AncestryChanged:connect(function()
  383.         if (not RoomClone:IsDescendantOf(game.Workspace.FX)) then
  384.             local HitBox = game.Workspace.FX:FindFirstChild("RoomHitBox")
  385.             HitBox:Destroy()
  386.             ROOMCOMPLETED = false
  387.         end
  388.     end)
  389. end)
  390.  
  391. Shambles.OnClientEvent:Connect(function(Player, mouseTarget)
  392.     if mouseTarget:IsA("MeshPart") or mouseTarget:IsA("BasePart") and mouseTarget.Parent:FindFirstChild("Humanoid") == true and not mouseTarget:IsDescendentOf(Player.Character) then
  393.         local PlayerLocation = Player.Character.HumanoidRootPart.CFrame
  394.         local EnemyLoction = mouseTarget.Parent.HumanoidRootPart.CFrame
  395.         Player.Character.HumanoidRootPart.CFrame = EnemyLoction
  396.         mouseTarget.Parent.HumanoidRootPart.CFrame = PlayerLocation
  397.         print("Shambles")
  398.     end
  399. end)
  400.  
  401.  
  402. TaktCreateEvent.OnClientEvent:Connect(function(Player, mouseLocation, Word)
  403.     local TaktRockClone = TaktRock:Clone()
  404.     TaktRockClone.Position = mouseLocation
  405. end)
  406.  
  407. TaktThrowEvent.OnClientEvent:Connect(function(Player, mouseLocation, Word)
  408.    
  409. end)
  410.  
  411. mouse1.Button1Down.Event:Connect(function()
  412.     if TOOLENABLED then
  413.         mouse1:SetTargetFilter(list)
  414.         cutEvent:FireServer(mouse1:GetUnitRay())
  415.     end
  416. end)
  417.  
  418.  
  419.  
  420. -- THIS IS THE LOCAL SCRIPT
  421.  
  422.  
  423.  
  424. -- // SERVICES
  425. local REPLICATED_STORAGE = game:GetService("ReplicatedStorage")
  426. local USER_INPUT_SERVICE = game:GetService("UserInputService")
  427. local PLAYERS = game:GetService("Players")
  428.  
  429. -- // VARIABLES
  430. local ActivateRoom = REPLICATED_STORAGE.DFS.Ope:WaitForChild("ActivateRoom")
  431. local RoomCreation = REPLICATED_STORAGE.DFS.Ope:WaitForChild("RoomCreation")
  432. local RoomExpansion = REPLICATED_STORAGE.DFS.Ope:WaitForChild("RoomExpansion")
  433. local ShamblesActivationEvent = REPLICATED_STORAGE.DFS.Ope:WaitForChild("ActivateShambles")
  434. local Shambles = REPLICATED_STORAGE.DFS.Ope:WaitForChild("Shambles")
  435. local TaktCreateEvent = REPLICATED_STORAGE.DFS.Ope:WaitForChild("TaktCreate")
  436. local TaktThrowEvent = REPLICATED_STORAGE.DFS.Ope:WaitForChild("TaktThrow")
  437.  
  438. -- // EVENTS
  439.  
  440. PLAYERS.PlayerAdded:Connect(function(Player)
  441.     Player.CharacterAdded:Connect(function(Character)
  442.         Character.Humanoid:SetAttribute("RoomEnabled", false)
  443.         local InsideRoom = Instance.new("BoolValue", Character)
  444.         InsideRoom.Name = "InsideRoom"
  445.     end)
  446. end)
  447.  
  448. ActivateRoom.OnServerEvent:Connect(function(Player, Word, x, y, z, x1, y1, z1, x2, y2, z2, ROOMTIME)
  449.     if Word == "Create" then
  450.         RoomCreation:FireAllClients(Player, Word)
  451.     end
  452.     if Word == "Expand" then
  453.         RoomExpansion:FireAllClients(Player, Word, x, y, z, x1, y1, z1, x2, y2, z2, ROOMTIME)
  454.     end
  455. end)
  456.  
  457. ShamblesActivationEvent.OnServerEvent:Connect(function(Player, mouseTarget)
  458.     Shambles:FireAllClients(Player, mouseTarget)
  459. end)
  460.  
  461. TaktCreateEvent.OnServerEvent:Connect(function(Player, mousePosition, Word)
  462.     if Word == "Create" then
  463.         TaktCreateEvent:FireAllClients(Player, mousePosition, Word)
  464.     end
  465.     if Word == "Throw" then
  466.         TaktThrowEvent:FireAllClients(Player, mousePosition, Word)
  467.     end
  468. end)
  469.  
  470. -- THIS IS THE SERVER SIDED SCRIPT
  471.  
  472.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement