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 |
|
|
| |
|
|
| 25 Jul 2015 06:48 PM |
have you tried html?
ususally if implement it,
it should work |
|
|
| Report Abuse |
|
|
| |
|
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
|
  |
| 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 |
|
|
|
| 25 Jul 2015 06:51 PM |
| That's because you're not using HTML |
|
|
| Report Abuse |
|
|
Gladii
|
  |
| Joined: 10 Mar 2012 |
| Total Posts: 1713 |
|
|
| 25 Jul 2015 06:52 PM |
| is this some excuse to crappost? |
|
|
| Report Abuse |
|
|
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
|
  |
| Joined: 10 Mar 2012 |
| Total Posts: 1713 |
|
|
| 25 Jul 2015 06:55 PM |
| Deprecated? (did they remove it?) |
|
|
| Report Abuse |
|
|
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 |
|
|
| |
|
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
|
  |
| Joined: 10 Mar 2012 |
| Total Posts: 1713 |
|
| |
|
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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 28 Jul 2008 |
| Total Posts: 1254 |
|
|
| 25 Jul 2015 06:59 PM |
| input.KeyCode.Name:Upper() == "B" |
|
|
| Report Abuse |
|
|
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
|
  |
| Joined: 10 Mar 2012 |
| Total Posts: 1713 |
|
|
| 25 Jul 2015 07:05 PM |
| notrhing seems to be working |
|
|
| Report Abuse |
|
|
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
|
  |
| 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
|
  |
| Joined: 26 Jul 2008 |
| Total Posts: 8002 |
|
|
| 25 Jul 2015 07:10 PM |
check the output pl0x
Godspeed |
|
|
| Report Abuse |
|
|
Gladii
|
  |
| Joined: 10 Mar 2012 |
| Total Posts: 1713 |
|
| |
|
Gladii
|
  |
| Joined: 10 Mar 2012 |
| Total Posts: 1713 |
|
| |
|