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: Help! (Simple KeyDown Event)

Previous Thread :: Next Thread 
FriendlyScripter is not online. FriendlyScripter
Joined: 19 Feb 2012
Total Posts: 222
08 Nov 2012 04:12 PM
function tacos(key)
key:lower()
if key == "r" then
local a = Instance.new("Message",game.Workspace)
a.Text = "Hello world"
wait(2)
a:Destroy()
end
function onSelected(mouse)
mouse.KeyDown:connect(onKeyDown)
end

script.Parent.Equipped:connect(onSelected)


Nothing happens...

The tool's name IS "Handle"


Report Abuse
OBF is not online. OBF
Joined: 29 Sep 2009
Total Posts: 10709
08 Nov 2012 04:14 PM
key = key:lower()
Report Abuse
FriendlyScripter is not online. FriendlyScripter
Joined: 19 Feb 2012
Total Posts: 222
08 Nov 2012 04:17 PM
@OBF; Thanks but it still didn't work....


Should I try :Selected instead of :Equipped?
Report Abuse
DeathLicht is not online. DeathLicht
Joined: 06 Jun 2011
Total Posts: 340
08 Nov 2012 04:18 PM
This is a new script i just wrote, it suppouse to work well..

script.Parent.Equipped:connect(function(mouse)
mouse.KeyDown:connect(function(key)
if key == "r" then
local a = Instance.new("Message",game.Workspace)
a.Text = "Hello world"
wait(2)
a:Destroy()
end
end)
end)
Report Abuse
FriendlyScripter is not online. FriendlyScripter
Joined: 19 Feb 2012
Total Posts: 222
08 Nov 2012 04:23 PM
@Death, I was so confident that yours was gonna work, but it didn't. :(
Report Abuse
OBF is not online. OBF
Joined: 29 Sep 2009
Total Posts: 10709
08 Nov 2012 04:25 PM
It looks like it should work then. Sorry.
Report Abuse
FriendlyScripter is not online. FriendlyScripter
Joined: 19 Feb 2012
Total Posts: 222
08 Nov 2012 04:26 PM
Wait, should this be in a local script?
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
08 Nov 2012 04:27 PM
The tool's name doesn't have to be Handle. A part inside of it should be.

¤¤ †KMXD† ¤¤
Report Abuse
FriendlyScripter is not online. FriendlyScripter
Joined: 19 Feb 2012
Total Posts: 222
08 Nov 2012 04:28 PM
@KMD.. Lol that's what I meant. :P
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
08 Nov 2012 04:28 PM
Lich's code looks good. I'm not sure why it's not working.

¤¤ †KMXD† ¤¤
Report Abuse
blackboy167thst is not online. blackboy167thst
Joined: 22 Jul 2011
Total Posts: 2468
08 Nov 2012 04:29 PM
Is it a HopperBin or Tool?
Report Abuse
FriendlyScripter is not online. FriendlyScripter
Joined: 19 Feb 2012
Total Posts: 222
08 Nov 2012 04:30 PM
Tool
Report Abuse
FriendlyScripter is not online. FriendlyScripter
Joined: 19 Feb 2012
Total Posts: 222
08 Nov 2012 04:33 PM
The script's parent is supposed to be Handle or Tool? \


>_>
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
08 Nov 2012 04:33 PM
Tool.

¤¤ †KMXD† ¤¤
Report Abuse
FriendlyScripter is not online. FriendlyScripter
Joined: 19 Feb 2012
Total Posts: 222
08 Nov 2012 04:34 PM
Thanks KMXD... The obvious things.. I don't pay attention to.. :/


Thank you so much guys!


*SOLVED*
Report Abuse
DeathLicht is not online. DeathLicht
Joined: 06 Jun 2011
Total Posts: 340
08 Nov 2012 04:35 PM
my script suppouse to work well.. else maybe u doing something wrong

The Tool's Name must be anythihg...

inside the tool; put a 'Part' called 'Handle'
inside the tool; put a 'Script' and write my script...
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
08 Nov 2012 04:37 PM
> The Tool's Name must be anythihg...

lol? I'm pretty sure it doesn't have to be "anythihg". :P

¤¤ †KMXD† ¤¤
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
08 Nov 2012 04:37 PM
^ My trolling friend everybody...

print(string.char(169).."easelessSoul".."|S"..string.char(169).."ripting Helper")
Report Abuse
FriendlyScripter is not online. FriendlyScripter
Joined: 19 Feb 2012
Total Posts: 222
08 Nov 2012 04:38 PM
@Death, I used your script it worked, the parent of the script was in Handle, not tool. Thanks!
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
08 Nov 2012 04:38 PM
^ My eternal servant everybody...

¤¤ †KMXD† ¤¤
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