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 » Scripters
Home Search
 

Re: not printing yay?

Previous Thread :: Next Thread 
Gladii is not online. Gladii
Joined: 10 Mar 2012
Total Posts: 1713
25 Jul 2015 06:47 PM
not sure why when I press B it doesn't print "yay"

game:GetService("UserInputService").InputBegan:connect(function(input)
if input.KeyCode == Enum.KeyCode.B then
print("yay")
--part.CFrame = part.CFrame * CFrame.new(0, 0, ((1/205)*mass.Value-50)/25)*CFrame.Angles(0, math.rad(45), 0)
end
end)
Report Abuse
Explosive1x1 is not online. Explosive1x1
Joined: 11 Mar 2014
Total Posts: 356
25 Jul 2015 06:48 PM
try using html
Report Abuse
symmetrics is not online. symmetrics
Joined: 29 May 2015
Total Posts: 85
25 Jul 2015 06:48 PM
have you tried html?


ususally if implement it,

it should work
Report Abuse
DestructiveFate is not online. DestructiveFate
Joined: 26 Apr 2015
Total Posts: 60
25 Jul 2015 06:48 PM
Try using HTML for it
Report Abuse
jasondee1 is not online. jasondee1
Joined: 26 Jul 2008
Total Posts: 8002
25 Jul 2015 06:48 PM
"Enum.KeyCode.B"

????????

http://wiki.roblox.com/index.php?title=API:Enum/KeyCode


Godspeed
Report Abuse
Gladii is not online. Gladii
Joined: 10 Mar 2012
Total Posts: 1713
25 Jul 2015 06:50 PM
if input.KeyCode == 98 then doesn't seem to work
Report Abuse
DestructiveFate is not online. DestructiveFate
Joined: 26 Apr 2015
Total Posts: 60
25 Jul 2015 06:51 PM
That's because you're not using HTML
Report Abuse
Gladii is not online. Gladii
Joined: 10 Mar 2012
Total Posts: 1713
25 Jul 2015 06:52 PM
is this some excuse to crappost?
Report Abuse
jasondee1 is not online. jasondee1
Joined: 26 Jul 2008
Total Posts: 8002
25 Jul 2015 06:54 PM
It's better to just use Keydown

http://wiki.roblox.com/index.php?title=KeyDown

its much easier


Godspeed
Report Abuse
Gladii is not online. Gladii
Joined: 10 Mar 2012
Total Posts: 1713
25 Jul 2015 06:55 PM
Deprecated? (did they remove it?)
Report Abuse
instawin is not online. instawin
Joined: 04 Jun 2013
Total Posts: 8777
25 Jul 2015 06:55 PM
make sure your script is a local script, and a descendant of the player (in their playergui, or backpack, etc)
Report Abuse
Jellybreadpie15 is not online. Jellybreadpie15
Joined: 02 Dec 2011
Total Posts: 391
25 Jul 2015 06:56 PM
more html
Report Abuse
instawin is not online. instawin
Joined: 04 Jun 2013
Total Posts: 8777
25 Jul 2015 06:56 PM
"Deprecated?"

deprecated, as in frowned upon when used in newer scripts

use UIS, it's standard now and more flexible
Report Abuse
Gladii is not online. Gladii
Joined: 10 Mar 2012
Total Posts: 1713
25 Jul 2015 06:56 PM
it is.
Report Abuse
jasondee1 is not online. jasondee1
Joined: 26 Jul 2008
Total Posts: 8002
25 Jul 2015 06:56 PM
use string.byte to translate the key to a byte (so you can use it for keys like B, A, backslash, ect)

mouse.KeyDown:connect(function (key) -- Run function
key = string.lower(key)
if string.byte(key) == 98 then
running = true
end
end)




Godspeed
Report Abuse
jasondee1 is not online. jasondee1
Joined: 26 Jul 2008
Total Posts: 8002
25 Jul 2015 06:57 PM
I don't see how mouse.KeyDown is depreciated, it's much easier than doing the :getservice() moolah crap.


Godspeed
Report Abuse
instawin is not online. instawin
Joined: 04 Jun 2013
Total Posts: 8777
25 Jul 2015 06:58 PM
@jason
no

local script in startergui or starterpack:

local uis = game:GetService("UserInputService")

uis.InputBegan:connect(function(input, gpe)
if not gpe and input.KeyCode == Enum.KeyCode.B then
print("b")
end
end)
Report Abuse
baldo46 is not online. baldo46
Joined: 28 Jul 2008
Total Posts: 1254
25 Jul 2015 06:59 PM
input.KeyCode.Name:Upper() == "B"
Report Abuse
jasondee1 is not online. jasondee1
Joined: 26 Jul 2008
Total Posts: 8002
25 Jul 2015 07:00 PM
r u srs

its literally the same thing

what is the difference


Godspeed
Report Abuse
Gladii is not online. Gladii
Joined: 10 Mar 2012
Total Posts: 1713
25 Jul 2015 07:05 PM
notrhing seems to be working
Report Abuse
jasondee1 is not online. jasondee1
Joined: 26 Jul 2008
Total Posts: 8002
25 Jul 2015 07:06 PM
is it in a localscript?

Make sure it isn't in the starterplayer or anything crazy like that.

Ideal place to put a localscript would be anywhere in the playergui or character


Godspeed
Report Abuse
Gladii is not online. Gladii
Joined: 10 Mar 2012
Total Posts: 1713
25 Jul 2015 07:07 PM
It's in the starter GUI and it is local.
Report Abuse
jasondee1 is not online. jasondee1
Joined: 26 Jul 2008
Total Posts: 8002
25 Jul 2015 07:10 PM
check the output pl0x


Godspeed
Report Abuse
Gladii is not online. Gladii
Joined: 10 Mar 2012
Total Posts: 1713
25 Jul 2015 07:12 PM
nada (nothing)
Report Abuse
Gladii is not online. Gladii
Joined: 10 Mar 2012
Total Posts: 1713
25 Jul 2015 07:22 PM
:(
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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