xKinqMill
|
  |
| Joined: 26 Jun 2014 |
| Total Posts: 545 |
|
|
| 05 Oct 2015 03:11 PM |
When i make an input event script, the function fires when you are typing.
Say you have this script:
local uis=game:GetService("UserInputService")
uis.InputBegan:connect(function(i) if i.KeyCode==Enum.KeyCode.R then -- reset player end end)
If i was chatting something and i said "r" the player would reset. I don't want it to fire when you are chatting. How do i get it not to fire when chatting? |
|
|
| Report Abuse |
|
|
|
| 05 Oct 2015 03:14 PM |
| Use :GetMouse() and KeyDown instead of user input service. |
|
|
| Report Abuse |
|
|
xKinqMill
|
  |
| Joined: 26 Jun 2014 |
| Total Posts: 545 |
|
|
| 05 Oct 2015 03:16 PM |
| KeyDown is depreciated. It no longer works. |
|
|
| Report Abuse |
|
|
xKinqMill
|
  |
| Joined: 26 Jun 2014 |
| Total Posts: 545 |
|
|
| 05 Oct 2015 03:18 PM |
| Is there another way to get a pressed key? |
|
|
| Report Abuse |
|
|
|
| 05 Oct 2015 03:19 PM |
KeyDown works but it's bad. Don't listen to DogBone. Use the second argument of InputBegan, gameProcessedEvent. It checks if you're chatting or not.
uis.InputBegan:connect(function(i, gpe) if not gpe then if i.KeyCode==Enum.KeyCode.R then -- reset player end end end) |
|
|
| Report Abuse |
|
|
| |
|
xKinqMill
|
  |
| Joined: 26 Jun 2014 |
| Total Posts: 545 |
|
| |
|
| |
|
|
| 05 Oct 2015 03:40 PM |
Oh god just use KeyDown, it works 100% of the time for me, and it's so much easily understood better.
http://www.roblox.com/Coon-left-item?id=296811217 http://www.roblox.com/Coon-right-item?id=296811237 |
|
|
| Report Abuse |
|
|
xKinqMill
|
  |
| Joined: 26 Jun 2014 |
| Total Posts: 545 |
|
|
| 05 Oct 2015 03:41 PM |
| Look up KeyDown on the wiki. Read the warning label. |
|
|
| Report Abuse |
|
|
xKinqMill
|
  |
| Joined: 26 Jun 2014 |
| Total Posts: 545 |
|
|
| 05 Oct 2015 03:42 PM |
| And i already said it doesn't work for me... |
|
|
| Report Abuse |
|
|
|
| 05 Oct 2015 03:44 PM |
@king
"Look up KeyDown on the wiki. Read the warning label."
What of it? It works perfectly fine for me. There's nothing wrong with it.
lp=game.Players.LocalPlayer repeat wait() until lp.Character mouse=game.Players.LocalPlayer:GetMouse() mouse.KeyDown:connect(function(key) if key=="r" then lp.Character:BreakJoints() end end)
Put that in a local script, it works perfectly fine.
http://www.roblox.com/Coon-left-item?id=296811217 http://www.roblox.com/Coon-right-item?id=296811237 |
|
|
| Report Abuse |
|
|
xKinqMill
|
  |
| Joined: 26 Jun 2014 |
| Total Posts: 545 |
|
|
| 05 Oct 2015 03:46 PM |
| ^ What kind of computer do you have? |
|
|
| Report Abuse |
|
|
xKinqMill
|
  |
| Joined: 26 Jun 2014 |
| Total Posts: 545 |
|
|
| 05 Oct 2015 03:49 PM |
| ^ Oh wow. It works. I tried it many times and it didn't work. I guess Roblox re-added it. |
|
|
| Report Abuse |
|
|
|
| 05 Oct 2015 03:51 PM |
"Oh god just use KeyDown, it works 100% of the time for me, and it's so much easily understood better."
simpler? if you have any understanding of Events you should be able to get used to UIS easily. keydown is deprecated for a reason.
UIS > keydown
and if you want to go a step further
CAS (contextactionservice) > UIS for mobile support |
|
|
| Report Abuse |
|
|
|
| 05 Oct 2015 03:52 PM |
mobile gaming is for 7 year olds anyways
http://www.roblox.com/Coon-left-item?id=296811217 http://www.roblox.com/Coon-right-item?id=296811237 |
|
|
| Report Abuse |
|
|
|
| 05 Oct 2015 03:55 PM |
| ok then keep using keydown. again, its deprecated for a (multitude of) reasons |
|
|
| Report Abuse |
|
|
|
| 05 Oct 2015 03:56 PM |
and what are the reasons? You're the type of person who thinks using :Remove() on one brick is going to destroy your entire game.
http://www.roblox.com/Coon-left-item?id=296811217 http://www.roblox.com/Coon-right-item?id=296811237 |
|
|
| Report Abuse |
|
|
|
| 05 Oct 2015 04:02 PM |
im the type of logical person who thinks Destroy() > remove() because destroy destroys a brick while remove parents it to nil. im also the kind of logical person who doesnt like to engage in *these* kind of arguments
http://www.roblox.com/Forum/ShowPost.aspx?PostID=175613503 |
|
|
| Report Abuse |
|
|
|
| 05 Oct 2015 04:03 PM |
I know :Destroy() is obviously more efficient, but i've seen a thread once where this new user needed help and his script had :Remove() and people lashed out on him calling him a scrub. I mean it was hilarious, but still.
http://www.roblox.com/Coon-left-item?id=296811217 http://www.roblox.com/Coon-right-item?id=296811237 |
|
|
| Report Abuse |
|
|
digpoe
|
  |
| Joined: 02 Nov 2008 |
| Total Posts: 9092 |
|
|
| 05 Oct 2015 04:04 PM |
@LOV they say "DO NOT USE FOR NEW WORK" for a reason
i.e. "we may remove this in the future but we're lazy right now" |
|
|
| Report Abuse |
|
|