This is the script called Server
local module = require(script.Parent.Module)
script.Parent.Cool.Cooldown.OnServerEvent:Connect(function(plr, truefalse)
script.Parent.Cool.Value = truefalse
end)
script.Parent.Cool.Fire.OnServerEvent:Connect(function(player, Enemy)
Enemy.HumanoidRootPart.Anchored = true
local SFX = script.Parent.Sounds.ForceCrush:Clone()
SFX.Parent = player.Character.HumanoidRootPart
SFX:Play()
game.Debris:AddItem(SFX, 5)
player.Character.Humanoid:LoadAnimation(script.Parent.Animations.Force):Play(0.2)
game:GetService("TweenService"):Create(Enemy.HumanoidRootPart, TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut, 0, false, 0), {CFrame = Enemy.HumanoidRootPart.CFrame * CFrame.new(0,5,0)}):Play()
spawn(function()
wait(1)
local anim = player.Character.Humanoid:LoadAnimation(script.Parent.Animations.ForceLoop)
anim:Play()
repeat wait()
Enemy.HumanoidRootPart.CFrame = CFrame.new(Enemy.HumanoidRootPart.Position, player.Character.HumanoidRootPart.Position)
until Enemy.Humanoid.Health <= 0
anim:Stop()
end)
wait(2)
Enemy.Humanoid:LoadAnimation(script.Parent.Animations.Victim):Play(0.3)
local FX = script.Parent.Particles.Attachment.Attachment:Clone()
FX.Parent = Enemy.HumanoidRootPart
FX.Flare.Enabled = true
local SFX2 = script.Parent.Sounds.Bones:Clone()
SFX2.Parent = Enemy.HumanoidRootPart
SFX2:Play()
local SFX3 = script.Parent.Sounds.Activate:Clone()
SFX3.Parent = Enemy.HumanoidRootPart
SFX3:Play()
local DisableGui = script.DisableGui:Clone()
DisableGui.Parent = Enemy.HumanoidRootPart
DisableGui.Disabled = false
game.Debris:AddItem(SFX3, 9)
game.Debris:AddItem(SFX2, 9)
game.Debris:AddItem(FX, 9)
wait(9)
Enemy.Humanoid:TakeDamage(1498075041047501374050874805706713067813743701043)
end)
Script called DisableGui
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
Script called Client
local player = game.Players.LocalPlayer
local tool = script.Parent
local module = require(script.Parent:WaitForChild("Module"))
local cool = script.Parent.Cool
local mouse = player:GetMouse()
tool.Activated:Connect(function()
local Target = mouse.Target
local Enemy = nil
while true do
if Target == nil then
break
end
if Target == game.Workspace then
break
end
if Target.Parent:FindFirstChild("Humanoid") then
Enemy = Target.Parent
break
end
Target = Target.Parent
end
if cool.Value == false then
module.CreateCooldown(tool, 0, tool.Name, script.Parent.Cool.Cooldown)
cool.Fire:FireServer(Enemy)
else
return
end
end)
Script called Module
local module = {}
function module.CreateCooldown(tool, cooldown, originalname, event)
spawn(function()
if script.Parent.Cool.Value == true then return end
tool.Name = cooldown
event:FireServer(true)
for i = 1,cooldown do
wait(1)
tool.Name = tool.Name - 1
end
tool.Name = originalname
event:FireServer(false)
end)
end
function module.CreateHitbox(Size, CoordinateFrame, player)
local hitbox = Instance.new("Part", workspace)
hitbox.CanCollide = false
hitbox.Size = Size
hitbox.CFrame = CoordinateFrame
hitbox.Name = player.Name.. "HitBox"
hitbox.Anchored = true
hitbox.Transparency = 1
for i,v in pairs(workspace:GetChildren()) do
if v:IsA("Model") and v:FindFirstChild("Humanoid") and v:FindFirstChild("HumanoidRootPart") and v ~= player then
if (hitbox.Position - v.HumanoidRootPart.Position).Magnitude <= 8 then
local BV = Instance.new("BodyVelocity", v.HumanoidRootPart)
BV.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
BV.Velocity = player.HumanoidRootPart.CFrame.lookVector * 90
v.Humanoid:LoadAnimation(script.Parent.Animations.Victim):Play(0.2)
v.HumanoidRootPart.CFrame = CFrame.new(v.HumanoidRootPart.Position, player.HumanoidRootPart.Position)
v.Humanoid.PlatformStand = true
spawn(function()
wait(3)
v.Humanoid.PlatformStand = false
end)
game.Debris:AddItem(BV, 0.3)
end
end
end
game.Debris:AddItem(hitbox, 2)
end
return module
My friend gave me his tools so I did not make these scripts