Force Field Tool
Script
local shield = script.Parent
shield.Equipped:Connect(function()
local player = shield.Parent
local force = Instance.new('ForceField')
force.Parent = player
end)
shield.Unequipped:Connect(function()
local player = shield.Parent.Parent
local model = game.Workspace:FindFirstChild(player.Name)
local force = model:FindFirstChildWhichIsA('ForceField')
force:Destroy()
end)
With Cooldown
local shield = script.Parent
local coolDown = 10
local start = 2
shield.Equipped:Connect(function(mouse)
wait(start)
local player = shield.Parent
local hasForce = player:FindFirstChildWhichIsA('ForceField')
if not hasForce then
local force = Instance.new('ForceField')
force.Parent = player
wait(coolDown)
if force then
force:Destroy()
end
end
end)
shield.Unequipped:Connect(function()
local player = shield.Parent.Parent
local model = game.Workspace:FindFirstChild(player.Name)
local force = model:FindFirstChildWhichIsA('ForceField')
if force then
force:Destroy()
end
end)