Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local DarkZone = ReplicatedStorage.Skills.Impure.DarkZone.Remotes.DarkZone
- local TweenService = game:GetService("TweenService")
- local Debris = game:GetService("Debris")
- local Players = game:GetService("Players")
- local RunService = game:GetService("RunService")
- local StunEvent = game.ServerStorage.Events.Stun
- local Stun = require(game.ServerStorage.BadEffects.Stun)
- local Silence = require(game.ServerStorage.BadEffects.Silence)
- local Effects = require(game.ServerStorage.Effects)
- local Unstopable = require(game.ServerStorage.GoodEffects.Unstoppable)
- local PlayerD
- local PStuned = false
- local function createPosition(part,hp)
- local Position = Vector3.new((part.CFrame.X - hp.CFrame.X) / 10,(part.CFrame.Y - hp.CFrame.Y) / 10,(part.CFrame.Z - hp.CFrame.Z) / 10)
- return Position
- end
- local function untrap(list)
- Stun.RemoveStun(PlayerD.Character,0)
- for i = 1, #list do
- list[i]:WaitForChild("HumanoidRootPart").Anchored = false
- end
- end
- local function trapPlayers(c,part)
- Silence.SilencePlayersAround(c,20,0)
- local Stuned = Stun.StunPlayersAround(c,20,0)
- for index = 1, #Stuned do
- local hp = Stuned[index]:WaitForChild("HumanoidRootPart")
- local Position = createPosition(part,hp)
- coroutine.wrap(function()
- for count = 1,10,1 do
- hp.CFrame = hp.CFrame + Position
- wait()
- end
- end)()
- end
- return Stuned
- end
- StunEvent.Event:Connect(function(c)
- if PlayerD then
- if PlayerD.Character == c then
- PStuned = true
- end
- end
- end)
- local function darkZoneF(player)
- local Meshes = script.Meshes
- local Character = player.Character
- local Humanoid = Character:WaitForChild("Humanoid")
- local HumanoidRP = Character:WaitForChild("HumanoidRootPart")
- local Track = Humanoid:LoadAnimation(script.DZone1)
- local Track2 = Humanoid:LoadAnimation(script.DZone2)
- local Track3 = Humanoid:LoadAnimation(script.DZone3)
- local Position
- local Model = Meshes:WaitForChild("Model"):Clone()
- Model.Parent = workspace
- Model.Name = player.Name.." DZone"
- Model.PrimaryPart = Model.Hbox
- local mDark = Meshes:WaitForChild("MDarkZone"):Clone()
- mDark.CFrame = Character:WaitForChild("LeftHand").CFrame * CFrame.new(0.8,0,-0.1)
- mDark.Parent = workspace
- local weld = Instance.new("WeldConstraint")
- weld.Parent = Model
- weld.Part0 = mDark
- weld.Part1 = Character:WaitForChild("LeftHand")
- Track2:Play()
- Track:Play()
- for count = 1,5,1 do
- if PStuned == true then
- Model:Destroy()
- mDark:Destroy()
- break
- end
- mDark.Transparency = mDark.Transparency - 0.2
- wait(0.2)
- end
- if PStuned == true then
- Model:Destroy()
- mDark:Destroy()
- Track2:Stop()
- return
- end
- Unstopable.Set(Character)
- wait(1)
- HumanoidRP.Anchored = true
- Position = Vector3.new(HumanoidRP.CFrame.X, HumanoidRP.CFrame.Y,HumanoidRP.CFrame.Z)
- Model:MoveTo(Position)
- mDark.Parent = Model
- Position = createPosition(Model.Hbox,HumanoidRP)
- local Stunned = trapPlayers(Character,Model.Hbox)
- for count = 1,10,1 do
- HumanoidRP.CFrame = HumanoidRP.CFrame + Position
- wait()
- end
- weld:Destroy()
- mDark.Anchored = true
- mDark.CFrame = Model.Hbox.CFrame
- Track3:Play()
- Track2:Stop()
- for count = 1,10,1 do
- mDark.Size = mDark.Size + Vector3.new(6.9,6.9,6.9)
- wait()
- end
- mDark.CanCollide = true
- HumanoidRP.Anchored = false
- untrap(Stunned)
- wait(10)
- Model.Hbox:Destroy()
- Model.MDarkZone:Destroy()
- Unstopable.Remove(Character)
- Silence.RemoveSilence(Character,0)
- Debris:AddItem(Model,10)
- end
- local function checkEnable(player)
- local checkSkill = require(game.ServerStorage.CheckCanSkill)
- if checkSkill.Check(player,"DZone") == true then
- PStuned = false
- PlayerD = player
- print("wwatatat")
- darkZoneF(player)
- end
- end
- DarkZone.OnServerEvent:Connect(checkEnable)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement