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: key down

Previous Thread :: Next Thread 
ninja900500 is not online. ninja900500
Joined: 27 Sep 2008
Total Posts: 2324
12 Oct 2013 06:48 PM
This is my KeyDown script. If you press "Shift" it prints ("hi"). It won't work. Please help.
Report Abuse
ProjectsHidden is not online. ProjectsHidden
Joined: 29 Sep 2013
Total Posts: 194
12 Oct 2013 06:49 PM
Post the script
Report Abuse
stephen1182 is not online. stephen1182
Joined: 31 Aug 2010
Total Posts: 4003
12 Oct 2013 06:49 PM
>troll
youareanidiot
.org
Report Abuse
lupine is not online. lupine
Joined: 24 Jun 2008
Total Posts: 3561
12 Oct 2013 06:51 PM
The shift key doesn't have an alphabetical character attatched to it, so you'd do something like

mouse.KeyDown:connect(function(key)
if key:byte() == 47 or 48 then -- 47 is left shift, 48 is right shift
Report Abuse
ninja900500 is not online. ninja900500
Joined: 27 Sep 2008
Total Posts: 2324
12 Oct 2013 06:51 PM
nvm fixed
Report Abuse
lupine is not online. lupine
Joined: 24 Jun 2008
Total Posts: 3561
12 Oct 2013 06:53 PM
48 is left, 47 is right shift*
Report Abuse
ninja900500 is not online. ninja900500
Joined: 27 Sep 2008
Total Posts: 2324
12 Oct 2013 06:58 PM
function KeyDownFunctions(key)
if key == "0" then
print 'true'
end
end


function KeyUpFunctions(key)
if key == "0" then
print 'false'
end
end

I need this one to be fixed. It doesn't work if i press shift. There is no output.
Report Abuse
xiaoxiao181 is not online. xiaoxiao181
Joined: 14 Aug 2008
Total Posts: 5882
12 Oct 2013 07:00 PM
Are you sure Lupine? When I used the byte printing both shifts returned as the same numbers. Might this be the case for certain keyboards? I use a logitech board
Report Abuse
stephen1182 is not online. stephen1182
Joined: 31 Aug 2010
Total Posts: 4003
12 Oct 2013 07:02 PM
...
For...
Different...
Keyboards...
*facedesk*
Report Abuse
ProjectsHidden is not online. ProjectsHidden
Joined: 29 Sep 2013
Total Posts: 194
12 Oct 2013 07:03 PM
function KeyDownFunctions(key)
if key:byte() == 47 or 48 then
print 'true'
end
end
function KeyUpFunctions(key)
if key:byte() == 47 or 48 then
print 'false'
end
end
Report Abuse
ninja900500 is not online. ninja900500
Joined: 27 Sep 2008
Total Posts: 2324
12 Oct 2013 07:05 PM
Doesn't work. I chose 48. I pressed left shift.
Report Abuse
ninja900500 is not online. ninja900500
Joined: 27 Sep 2008
Total Posts: 2324
12 Oct 2013 07:08 PM
nvm found out
Report Abuse
ninja900500 is not online. ninja900500
Joined: 27 Sep 2008
Total Posts: 2324
12 Oct 2013 07:29 PM
function KeyDownFunctions(key)
if key == "0" then
print 'true'
end
end
function KeyUpFunctions(key)
if key == "0" then
print 'false'
end
end

function Equip(Mouse)
wait()
if Mouse == nil then
print("Mouse not found")
return
end
mouse.KeyDown:connect(KeyDownFunctions)
mouse.KeyUp:connect(KeyUpFunctions)
end

script.Parent.Selected:connect (Equip)

I tried to fix it. This is what I got. Still doesn't work.
Report Abuse
ninja900500 is not online. ninja900500
Joined: 27 Sep 2008
Total Posts: 2324
12 Oct 2013 08:01 PM
found it
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