generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: About Keydown's

Previous Thread :: Next Thread 
Aisoc is not online. Aisoc
Joined: 08 Jun 2013
Total Posts: 412
18 May 2014 05:01 PM
Player = script.Parent.Parent
mouse = Player:GetMouse()

function onKeyDown(Key) -- i am not sure what is wrong i cant find it..
key = key:lower()
if key == "r" then
Instance.new("Part", Workspace)
end
end

if key:byte() == 32 then
print("key byte is 32")
end
mouse.KeyDown:connect(onKeyDown)

Output

23:58:05.840 - Exception: Cannot attach debugger
23:58:19.412 - Players.Player1.Backpack.LocalScript:12: attempt to index global 'key' (a nil value)
23:58:19.413 - Stack Begin
23:58:19.413 - Script 'Players.Player1.Backpack.LocalScript', Line 12
23:58:19.414 - Stack End
Report Abuse
Aisoc is not online. Aisoc
Joined: 08 Jun 2013
Total Posts: 412
18 May 2014 05:04 PM
Bump.
Report Abuse
DivineTempest is not online. DivineTempest
Joined: 25 Jan 2009
Total Posts: 289
18 May 2014 05:11 PM
ONE PIECE SACRED DAWN 4 LYFE.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
18 May 2014 05:16 PM
change they "Key" to "key" in the function params
Report Abuse
Aisoc is not online. Aisoc
Joined: 08 Jun 2013
Total Posts: 412
18 May 2014 05:27 PM
local p = game.Players.LocalPlayer
local m = p:GetMouse()

m.KeyDown:connect(function(Key)
Key = Key:lower()
if Key == "q" then
print("") -- ok fixed it
end
end)

nvm
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image