Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ OPE OPE NO MI Created By: RB_Nostalgia
- First Move: Room
- Second Move: Shambles
- Third Move: Takt]]--
- -- // SERVICES
- local REPLICATED_STORAGE = game:GetService("ReplicatedStorage")
- local USER_INPUT_SERVICE = game:GetService("UserInputService")
- local TWEEN_SERVICE = game:GetService("TweenService")
- local DEBRIS_SERVICE = game:GetService("Debris")
- -- // VARIABLES
- local InsideRoom = false
- local mouseMod = require(script:WaitForChild("Mouse"))
- local cutEvent = game.ReplicatedStorage.DFS.Ope:WaitForChild("Cut")
- local mouse1 = mouseMod:New()
- local ROOMTIME = nil
- local TOOLENABLED = false
- local HOLDTIME = nil
- local DEBOUNCE = false
- local DEBOUNCE2 = false
- local ROOMCOOLDOWN = 15
- local CANCELLCOOLDOWN = 3.5
- local LocalPlayer = game.Players.LocalPlayer
- repeat wait() until LocalPlayer.Character
- local Character = LocalPlayer.Character
- local Humanoid = Character:WaitForChild("Humanoid")
- local Animator = Humanoid:WaitForChild("Animator")
- local mouse = LocalPlayer:GetMouse()
- local ActivateRoom = REPLICATED_STORAGE.DFS.Ope:WaitForChild("ActivateRoom")
- local RoomCreation = REPLICATED_STORAGE.DFS.Ope:WaitForChild("RoomCreation")
- local RoomPart = REPLICATED_STORAGE.DFS.Ope:WaitForChild("Room_Part")
- local RoomActivationAnim = REPLICATED_STORAGE.DFS.Ope.Animations:WaitForChild("Room_Anim")
- local RoomExpansion = REPLICATED_STORAGE.DFS.Ope:WaitForChild("RoomExpansion")
- local BlueRing = REPLICATED_STORAGE.DFS.Ope:WaitForChild("BlueRing")
- local SmokeRing = REPLICATED_STORAGE.DFS.Ope:WaitForChild("SmokeRing")
- local ShamblesActivationEvent = REPLICATED_STORAGE.DFS.Ope:WaitForChild("ActivateShambles")
- local Shambles = REPLICATED_STORAGE.DFS.Ope:WaitForChild("Shambles")
- local ROOMCOMPLETED = false
- local SHAMBLESCOOLDOWN = 2
- local TAKTCOOLDOWN = 2
- local SHAMBLESENABLED = true
- local TAKTENABLED = true
- local TaktCreateEvent = REPLICATED_STORAGE.DFS.Ope:WaitForChild("TaktCreate")
- local TaktThrowEvent = REPLICATED_STORAGE.DFS.Ope:WaitForChild("TaktThrow")
- local list = {game.Workspace.FX:GetDescendants(), game.Workspace.Baseplate}
- local TaktRock = REPLICATED_STORAGE.DFS.Ope:WaitForChild("TaktRock")
- local x,y,z = 15,15,15
- local x1,y1,z1 = 0.158, 1.605, 1.605
- local x2,y2,z2 = 0.3, 0.3, 0.3
- local FirstRoomTweenInfo = TweenInfo.new(
- .5,
- Enum.EasingStyle.Back,
- Enum.EasingDirection.Out,
- 0,
- false,
- 0
- )
- local FirstRoomTweenGoals = {
- Scale = Vector3.new(0.3, 0.3, 0.3)
- }
- local SecondRoomTweenInfo = TweenInfo.new(
- .5,
- Enum.EasingStyle.Back,
- Enum.EasingDirection.Out,
- 0,
- false,
- 0
- )
- local CancelRoomTweenInfo = TweenInfo.new(
- .5,
- Enum.EasingStyle.Back,
- Enum.EasingDirection.In,
- 0,
- false,
- 0
- )
- local CancelRoomTweenGoals = {
- Scale = Vector3.new(0, 0, 0)
- }
- local BlueRingTweenInfo = TweenInfo.new(
- .3,
- Enum.EasingStyle.Linear,
- Enum.EasingDirection.Out,
- 0,
- false,
- 0
- )
- local BlueRingTransparencyTweenInfo = TweenInfo.new(
- 1,
- Enum.EasingStyle.Linear,
- Enum.EasingDirection.In,
- 0,
- false,
- 0
- )
- local SmokeRingTweenInfo = TweenInfo.new(
- .3,
- Enum.EasingStyle.Back,
- Enum.EasingDirection.Out,
- 0,
- false,
- 0
- )
- local SmokeRingExpandTweenInfo = TweenInfo.new(
- .4,
- Enum.EasingStyle.Back,
- Enum.EasingDirection.Out,
- 0,
- false,
- 0
- )
- local SmokeRingTransparencyTweenInfo = TweenInfo.new(
- 1.2,
- Enum.EasingStyle.Linear,
- Enum.EasingDirection.Out,
- 0,
- false,
- .6
- )
- -- // EVENTS
- script.Parent.Equipped:Connect(function()
- TOOLENABLED = true
- end)
- script.Parent.Unequipped:Connect(function()
- TOOLENABLED = false
- end)
- USER_INPUT_SERVICE.InputBegan:Connect(function(input, GPE)
- if GPE then return end
- if input.KeyCode == Enum.KeyCode.Q then
- if TOOLENABLED == true then
- if DEBOUNCE == false then
- DEBOUNCE = true
- local RoomActivationAnimTrack = LocalPlayer.Character:FindFirstChild("Humanoid"):LoadAnimation(RoomActivationAnim)
- RoomActivationAnimTrack:Play()
- HOLDTIME = os.clock()
- RoomActivationAnimTrack:GetMarkerReachedSignal("HoldEvent"):Connect(function()
- RoomActivationAnimTrack:AdjustSpeed(0)
- Character.HumanoidRootPart.Anchored = true
- Humanoid.WalkSpeed = 0
- ActivateRoom:FireServer("Create")
- end)
- end
- end
- end
- end)
- USER_INPUT_SERVICE.InputEnded:Connect(function(input, GPE)
- if GPE then return end
- if input.KeyCode == Enum.KeyCode.Q then
- local UNPRESSTIME = os.clock()
- if TOOLENABLED == true then
- if DEBOUNCE == true then
- if DEBOUNCE2 == false then
- if UNPRESSTIME - HOLDTIME >= 1.5 then
- DEBOUNCE2 = true
- ROOMTIME = (UNPRESSTIME - HOLDTIME) * 5
- local TimeHeld = 0
- if UNPRESSTIME - HOLDTIME > 10 then
- TimeHeld = 65
- else
- TimeHeld = (UNPRESSTIME - HOLDTIME)^2
- end
- ROOMCOOLDOWN = ROOMCOOLDOWN + TimeHeld
- x, y, z = x + TimeHeld, y + TimeHeld, z + TimeHeld
- x1, y1, z1 = x * 4.2, 0.063, z * 4.2
- x2, y2, z2 = x * 4, y * 4, z * 1.2
- local AnimationTracks = Animator:GetPlayingAnimationTracks()
- ActivateRoom:FireServer("Expand", x, y, z, x1, y1, z1, x2, y2, z2, ROOMTIME)
- for i, tracks in pairs(AnimationTracks) do
- tracks:AdjustSpeed(1)
- end
- Humanoid.WalkSpeed = 16
- Character.HumanoidRootPart.Anchored = false
- wait(ROOMCOOLDOWN)
- DEBOUNCE2 = false
- DEBOUNCE = false
- print("Off_Cooldown")
- elseif UNPRESSTIME - HOLDTIME > 0.1 and UNPRESSTIME - HOLDTIME < 1.5 then
- DEBOUNCE2 = true
- local RoomPart = game.Workspace.FX.Room_Part
- local CancelRoomTween = TWEEN_SERVICE:Create(RoomPart.Mesh, CancelRoomTweenInfo, CancelRoomTweenGoals)
- CancelRoomTween:Play()
- wait(.6)
- RoomPart:Destroy()
- local AnimationTracks = Animator:GetPlayingAnimationTracks()
- for i, tracks in pairs(AnimationTracks) do
- tracks:AdjustSpeed(1)
- end
- Humanoid.WalkSpeed = 16
- Character.HumanoidRootPart.Anchored = false
- wait(ROOMCOOLDOWN)
- DEBOUNCE2 = false
- DEBOUNCE = false
- print("OffCooldown")
- end
- end
- end
- end
- end
- end)
- USER_INPUT_SERVICE.InputBegan:Connect(function(input, GPE)
- if GPE then return end
- if input.KeyCode == Enum.KeyCode.E then
- if TOOLENABLED == true then
- if game.Workspace.FX:FindFirstChild("Room_Part") then
- if ROOMCOMPLETED == true then
- if SHAMBLESENABLED == true then
- SHAMBLESENABLED = false
- local mouseTarget = mouse.Target
- ShamblesActivationEvent:FireServer(mouseTarget)
- if mouseTarget:IsA("MeshPart") or mouseTarget:IsA("BasePart") and mouseTarget.Parent:FindFirstChild("Humanoid") == true then
- wait(SHAMBLESCOOLDOWN)
- else
- return
- end
- SHAMBLESENABLED = true
- end
- end
- end
- end
- end
- end)
- USER_INPUT_SERVICE.InputBegan:Connect(function(input, GPE)
- if GPE then return end
- if input.KeyCode == Enum.KeyCode.R then
- if TOOLENABLED == true then
- if game.Workspace.FX:FindFirstChild("Room_Part") then
- if ROOMCOMPLETED == true then
- if TAKTENABLED == true then
- TAKTENABLED = false
- local mouseLocation = mouse.Hit.p
- TaktCreateEvent:FireServer(mouseLocation, "Create")
- end
- end
- end
- end
- end
- end)
- USER_INPUT_SERVICE.InputBegan:Connect(function(input, GPE)
- if GPE then return end
- if input.KeyCode == Enum.KeyCode.R then
- if TOOLENABLED == true then
- if game.Workspace.FX:FindFirstChild("Room_Part") then
- if ROOMCOMPLETED == true then
- if TAKTENABLED == false then
- TAKTENABLED = true
- local mouseLocation = mouse.Hit.p
- TaktCreateEvent:FireServer(mouseLocation, "Expand")
- end
- end
- end
- end
- end
- end)
- RoomCreation.OnClientEvent:Connect(function(Player,Word) -- THIS IS WHERE THE ROOM IS MADE IN THE HAND
- Player.Character.Humanoid:SetAttribute("RoomEnabled", true)
- local RoomClone = RoomPart:Clone()
- local SmokeRingClone = SmokeRing:Clone()
- local HitBox = Instance.new("Part")
- HitBox.Shape = Enum.PartType.Ball
- HitBox.Transparency = 1
- HitBox.Name = "RoomHitBox"
- HitBox.Anchored = true
- HitBox.CanCollide = false
- HitBox.CastShadow = false
- SmokeRingClone.Parent = game.Workspace.FX
- RoomClone.Parent = game.Workspace.FX
- HitBox.Parent = game.Workspace.FX
- local RingClone = BlueRing:Clone()
- RingClone.Parent = game.Workspace.FX
- RingClone.CFrame = Player.Character.HumanoidRootPart.CFrame * CFrame.new(0,-3,0)
- RingClone.CFrame = RingClone.CFrame * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0))
- HitBox.Size = RoomClone.Mesh.Scale + Vector3.new(3.9,3.9,3.9)
- local RightHand = Player.Character.RightHand
- RoomClone.CFrame = RightHand.CFrame + (RightHand.CFrame.upVector * -1)
- HitBox.CFrame = RoomClone.CFrame
- SmokeRingClone.CFrame = RoomClone.CFrame
- SmokeRingClone.CFrame = CFrame.new(RoomClone.Position) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(0))
- local SmokeRingTweenGoals = {
- Scale = Vector3.new(1.3, 1.3, 1.3)
- }
- local HitBoxTweenGoals = {
- Size = Vector3.new(1.3*3.9, 1.3*3.9, 1.3*3.9)
- }
- local FirstRoomTween = TWEEN_SERVICE:Create(RoomClone.Mesh,FirstRoomTweenInfo, FirstRoomTweenGoals)
- local SmokeRingTween = TWEEN_SERVICE:Create(SmokeRingClone.Mesh, SmokeRingTweenInfo, SmokeRingTweenGoals)
- local FirstHitBoxTween = TWEEN_SERVICE:Create(HitBox, FirstRoomTweenInfo, HitBoxTweenGoals)
- SmokeRingTween:Play()
- FirstRoomTween:Play()
- FirstHitBoxTween:Play()
- end)
- RoomExpansion.OnClientEvent:Connect(function(Player, Word, x, y, z, x1, y1, z1, x2, y2, z2, ROOMTIME)
- local HitBox = game.Workspace.FX:WaitForChild("RoomHitBox")
- local RoomClone = game.Workspace.FX:WaitForChild("Room_Part")
- local SmokeRingClone = game.Workspace.FX:WaitForChild("SmokeRing")
- local RingClone = game.Workspace.FX:WaitForChild("BlueRing")
- RingClone.Transparency = 0
- local SecondRoomTweenGoals = {
- Scale = Vector3.new(x, y, z)
- }
- local BlueRingTweenGoals = {
- Size = Vector3.new(x1, y1, z1),
- }
- local BlueRingTransparencyTweenGoals = {
- Transparency = 1
- }
- local SmokeRingExpandTweenGoals = {
- Scale = Vector3.new(x2, y2, z2)
- }
- local SmokeRingTransparencyTweenGoals = {
- Transparency = 1
- }
- local HitBoxExpandTweenGoals = {
- Size = Vector3.new(x*3.9, y*3.9, z*3.9)
- }
- local SecondRoomTween = TWEEN_SERVICE:Create(RoomClone.Mesh, SecondRoomTweenInfo, SecondRoomTweenGoals)
- local HitBoxExpandTween = TWEEN_SERVICE:Create(HitBox, SecondRoomTweenInfo, HitBoxExpandTweenGoals)
- RoomClone.CFrame = Player.Character.HumanoidRootPart.CFrame
- HitBox.CFrame = RoomClone.CFrame
- local BlueRingTween = TWEEN_SERVICE:Create(RingClone, BlueRingTweenInfo, BlueRingTweenGoals)
- local BlueRingTransparencyTween = TWEEN_SERVICE:Create(RingClone, BlueRingTransparencyTweenInfo, BlueRingTransparencyTweenGoals)
- local SmokeRingExpandTween = TWEEN_SERVICE:Create(SmokeRingClone.Mesh, SmokeRingExpandTweenInfo, SmokeRingExpandTweenGoals)
- local SmokeRingTransparencyTween = TWEEN_SERVICE:Create(SmokeRingClone, SmokeRingTransparencyTweenInfo, SmokeRingTransparencyTweenGoals)
- BlueRingTween:Play()
- BlueRingTransparencyTween:Play()
- SmokeRingExpandTween:Play()
- SecondRoomTween:Play()
- HitBoxExpandTween:Play()
- SmokeRingTransparencyTween:Play()
- HitBoxExpandTween.Completed:Connect(function()
- ROOMCOMPLETED = true
- local pos1 = HitBox.Position - (HitBox.Size / 2)
- local pos2 = HitBox.Position + (HitBox.Size / 2)
- local region3 = Region3.new(pos1,pos2)
- while RoomClone.Parent ~= nil do
- wait()
- local deb = false
- local partsInRegion = game.Workspace:FindPartsInRegion3(region3, Player.Character, math.huge)
- if deb == false then
- deb = true
- for i, parts in pairs(partsInRegion) do
- if parts.Parent:FindFirstChild("Humanoid") then
- print(parts.Parent.Name)
- return
- end
- end
- end
- end
- end)
- DEBRIS_SERVICE:AddItem(RoomClone, ROOMTIME)
- DEBRIS_SERVICE:AddItem(SmokeRingClone, 4)
- DEBRIS_SERVICE:AddItem(RingClone, 2)
- RoomClone.AncestryChanged:connect(function()
- if (not RoomClone:IsDescendantOf(game.Workspace.FX)) then
- local HitBox = game.Workspace.FX:FindFirstChild("RoomHitBox")
- HitBox:Destroy()
- ROOMCOMPLETED = false
- end
- end)
- end)
- Shambles.OnClientEvent:Connect(function(Player, mouseTarget)
- if mouseTarget:IsA("MeshPart") or mouseTarget:IsA("BasePart") and mouseTarget.Parent:FindFirstChild("Humanoid") == true and not mouseTarget:IsDescendentOf(Player.Character) then
- local PlayerLocation = Player.Character.HumanoidRootPart.CFrame
- local EnemyLoction = mouseTarget.Parent.HumanoidRootPart.CFrame
- Player.Character.HumanoidRootPart.CFrame = EnemyLoction
- mouseTarget.Parent.HumanoidRootPart.CFrame = PlayerLocation
- print("Shambles")
- end
- end)
- TaktCreateEvent.OnClientEvent:Connect(function(Player, mouseLocation, Word)
- local TaktRockClone = TaktRock:Clone()
- TaktRockClone.Position = mouseLocation
- end)
- TaktThrowEvent.OnClientEvent:Connect(function(Player, mouseLocation, Word)
- end)
- mouse1.Button1Down.Event:Connect(function()
- if TOOLENABLED then
- mouse1:SetTargetFilter(list)
- cutEvent:FireServer(mouse1:GetUnitRay())
- end
- end)
- -- THIS IS THE LOCAL SCRIPT
- -- // SERVICES
- local REPLICATED_STORAGE = game:GetService("ReplicatedStorage")
- local USER_INPUT_SERVICE = game:GetService("UserInputService")
- local PLAYERS = game:GetService("Players")
- -- // VARIABLES
- local ActivateRoom = REPLICATED_STORAGE.DFS.Ope:WaitForChild("ActivateRoom")
- local RoomCreation = REPLICATED_STORAGE.DFS.Ope:WaitForChild("RoomCreation")
- local RoomExpansion = REPLICATED_STORAGE.DFS.Ope:WaitForChild("RoomExpansion")
- local ShamblesActivationEvent = REPLICATED_STORAGE.DFS.Ope:WaitForChild("ActivateShambles")
- local Shambles = REPLICATED_STORAGE.DFS.Ope:WaitForChild("Shambles")
- local TaktCreateEvent = REPLICATED_STORAGE.DFS.Ope:WaitForChild("TaktCreate")
- local TaktThrowEvent = REPLICATED_STORAGE.DFS.Ope:WaitForChild("TaktThrow")
- -- // EVENTS
- PLAYERS.PlayerAdded:Connect(function(Player)
- Player.CharacterAdded:Connect(function(Character)
- Character.Humanoid:SetAttribute("RoomEnabled", false)
- local InsideRoom = Instance.new("BoolValue", Character)
- InsideRoom.Name = "InsideRoom"
- end)
- end)
- ActivateRoom.OnServerEvent:Connect(function(Player, Word, x, y, z, x1, y1, z1, x2, y2, z2, ROOMTIME)
- if Word == "Create" then
- RoomCreation:FireAllClients(Player, Word)
- end
- if Word == "Expand" then
- RoomExpansion:FireAllClients(Player, Word, x, y, z, x1, y1, z1, x2, y2, z2, ROOMTIME)
- end
- end)
- ShamblesActivationEvent.OnServerEvent:Connect(function(Player, mouseTarget)
- Shambles:FireAllClients(Player, mouseTarget)
- end)
- TaktCreateEvent.OnServerEvent:Connect(function(Player, mousePosition, Word)
- if Word == "Create" then
- TaktCreateEvent:FireAllClients(Player, mousePosition, Word)
- end
- if Word == "Throw" then
- TaktThrowEvent:FireAllClients(Player, mousePosition, Word)
- end
- end)
- -- THIS IS THE SERVER SIDED SCRIPT
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement