Player = script.Parent.Parent mouse = Player:GetMouse() function onKeyDown(key) key = key:lower() if key == "z" then x = Instance.new("Part") x.BrickColor = BrickColor.new("Bright red") x.Size = Vector3.new(10,10,10) x.TopSurface = "Smooth" x.BottomSurface = "Smooth" x.Shape = "Ball" x.Tranparency = 0.7 y = Instance.new("BodyVelocity") y.maxForce = Vector3.new(math.huge, math.huge, math.huge) y.Velocity = Player.Character.Torso.CFrame.lookVector*80 x.Parent = game.Workspace y.Parent = x f = Instance.new("Fire", x) f.Size = 12 f.Heat = 0 x.Cframe = Player.Character.Torso.CFrame*CFrame.new(0, 0, -12) game.Debris:AddItem(x, 6) end end mouse.KeyDown:connect(onKeyDown)
Put local in front of the variables. Good luck!