Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I can't figure out why Keydown won't work?

Asked by
Okazii 0
10 years ago

-function onKeyDown(key) Key = key:lower() - if key == "z" then x = Instance.new("Part") x.BrickColor = BrickColor.new("Really Red") x.Size = Vector3.new(5, 5, 5) x.TopSurface = "Smooth" x.BottomSurface = "Smooth" x.Shape = "Ball" x.Transparency = 0.2 y = Instance.new("BodyVelocity") y.maxForce = Vector3.new("math.huge, math.huge, math.huge") y.velocity = Player.Character.Torso.CFrame.lookVector*80 x.Parent = Workspace y.Parent = x f = Instance.new("Fire") f.Size = 12 f.Heat = 0 game.Debris:AddItem(x, 6)

1 answer

Log in to vote
0
Answered by
Hibobb 40
10 years ago

Key = key:lower() if key == "z"

You forgot to capitalize key from here on out

0
Nope still doesn't work. It still underlines onKeyDown in red. Okazii 0 — 10y
0
Hover your mouse over the red line, what comes up? Hibobb 40 — 10y
Ad

Answer this question