Meaning, how can I... STOP people from spamming F in this Fireball script?
-------------------------------------Gunter5's Fireball Script----------------------------------------
wait(1)
Player = script.Parent.Parent -- Gets LocalPlayer
Character = Player.Character -- Gets Players Character
Mouse = Player:GetMouse() -- Gets players Mouse
function onKeyDown(key)
key = key:lower()
if key == "f" then -- Press F To Shoot Fireball
local x = Instance.new("Part")
x.TopSurface = "Smooth"
x.BottomSurface = "Smooth"
x.Shape = "Ball"
x.Transparency = .7
x.BrickColor = BrickColor.new("Bright red")
local z = Instance.new("Fire")
z.Parent = x
z.Size = 12
z.Heat = 8
local y = Instance.new("BodyVelocity")
y.maxForce = Vector3.new(math.huge, math.huge, math.huge)
y.velocity = Character.Torso.CFrame.lookVector*80
y.Parent = x
x.Parent = game.Workspace
x.CFrame = Character.Torso.CFrame*CFrame.new(0, 0, -12)
local x = 1
repeat
wait(2)
:remove(x)
x = x + 1
until x==0
end
end
Mouse.KeyDown:connect(onKeyDown)
No, this is not mine, BUT!!! I've edited some things that were wrong with it to fix it.. so, how can I prevent people from spamming F?
