Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

-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

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

You forgot to capitalize key from here on out

2 comments

0

Nope still doesn't work. It still underlines onKeyDown in red.

0

Hover your mouse over the red line, what comes up?

This discussion is preserved as it was. New answers, comments, and votes are closed.