This is force pull, people keep spamming the key. Is there a way to cooldown it?
wait(5) -- Wait for the Character to load
local User = game.Players.LocalPlayer
local mouse = User:GetMouse()
Animation = Instance.new("Animation")
Animation.AnimationId = "http://www.roblox.com/Asset?ID=166143393"
Animation.Name = "Force pull."
local animTrack = User.Character.Humanoid:LoadAnimation(Animation)
forceValue = -200 -- The ammount of force to use, for easy changeing
function ForcePush(key) --This function is run every time that a person presses a button on the Keyboard
if key == "e" then -- Checks if the button is F
if mouse.Target ~= nil and mouse.Target:IsA("BasePart") then -- Checks if the mouse is over a part
if mouse.Target.Parent:IsA("Hat") then -- If its over a hat
animTrack:Play() --Plays Anim
mouse.Target.Parent.Parent.Torso.Velocity = (workspace.CurrentCamera.CoordinateFrame.lookVector*forceValue) + Vector3.new(0,70,0) -- Forces
elseif mouse.Target.Parent:FindFirstChild("Humanoid") then -- If its over a body part
animTrack:Play() --Plays Anim
mouse.Target.Parent.Torso.Velocity = (workspace.CurrentCamera.CoordinateFrame.lookVector*forceValue) + Vector3.new(0,70,0) -- Forces
end
end
end
end
mouse.KeyDown:connect(ForcePush)

2 comments
You put wait(5) debounce = true.
Thank you.