Aisoc
|
  |
| Joined: 08 Jun 2013 |
| Total Posts: 412 |
|
|
| 02 Jul 2014 07:01 PM |
I made keydown and i am not sure what is wrong here
local Player = game.Players.LocalPlayer local Mouse = Player:GetMouse() if key == "a" and key == "z" then print("b") end |
|
|
| Report Abuse |
|
|
|
| 02 Jul 2014 07:02 PM |
You need to make an event for the button press. In this case, the KeyDown event will do the trick.
local Player = game.Players.LocalPlayer local Mouse = Player:GetMouse() Mouse.KeyDown:connect(function(key) if key == "a" and key == "z" then print("b") end end)
-[::ƧѡÎḾḠΰῩ::]-[::Helper of Scripting and Writer of Wikis::] |
|
|
| Report Abuse |
|
|
Aisoc
|
  |
| Joined: 08 Jun 2013 |
| Total Posts: 412 |
|
|
| 02 Jul 2014 07:04 PM |
| No it doesnt working i tried ... |
|
|
| Report Abuse |
|
|
|
| 02 Jul 2014 07:05 PM |
-- I don't know how you would do for multiple keys at once, but this works for one key
local Player = game.Players.LocalPlayer local Mouse = Player:GetMouse() Mouse.KeyDown:connect(function(key) if key == "a" then print("b") end end)
|
|
|
| Report Abuse |
|
|
|
| 02 Jul 2014 07:05 PM |
if key == "a" and key == "z" then
One key can't be two values. Did you mean to have 'or' instead of 'and'?
-[::ƧѡÎḾḠΰῩ::]-[::Helper of Scripting and Writer of Wikis::] |
|
|
| Report Abuse |
|
|
Aisoc
|
  |
| Joined: 08 Jun 2013 |
| Total Posts: 412 |
|
|
| 03 Jul 2014 07:19 AM |
| Dude i want to make multiple keys |
|
|
| Report Abuse |
|
|
|
| 03 Jul 2014 07:22 AM |
local Player = game.Players.LocalPlayer local Mouse = Player:GetMouse() local Keys = {}
Mouse.KeyDown:connect(function(key) Keys[key] = true end) Mouse.KeyUp:connect(function(key) Keys[key] = nil end)
if Keys["a"] and Keys["z"] then print("b") end
~The herp lerped a derp~ |
|
|
| Report Abuse |
|
|
|
| 03 Jul 2014 07:43 AM |
@filip
That if will run most likely before any key presses. |
|
|
| Report Abuse |
|
|
|
| 03 Jul 2014 07:51 AM |
That is for him to figure out by himself :P I only did exactly what he told us to, he has to learn you know ._.
~The herp lerped a derp~ |
|
|
| Report Abuse |
|
|
|
| 03 Jul 2014 07:57 AM |
Alright so give the noob to KeyDown a weird non-indented script, that will not do what he wanted, just so he can resort to giving up?
I hardly call that learning.
Nice coverup for you mistake though lol :P |
|
|
| Report Abuse |
|
|
Aisoc
|
  |
| Joined: 08 Jun 2013 |
| Total Posts: 412 |
|
|
| 03 Jul 2014 10:56 AM |
Seriously u think i didnt search before asking you... i tried come paste same script still it doesn't work
If you are not going to help me just leave this post |
|
|
| Report Abuse |
|
|
Aisoc
|
  |
| Joined: 08 Jun 2013 |
| Total Posts: 412 |
|
|
| 03 Jul 2014 10:57 AM |
#filiptibell
Good copy paste.. |
|
|
| Report Abuse |
|
|
|
| 03 Jul 2014 11:31 AM |
I use this all the time, so I copied it and pasted here from one of my places What's your point ._.
~The herp lerped a derp~ |
|
|
| Report Abuse |
|
|
Aisoc
|
  |
| Joined: 08 Jun 2013 |
| Total Posts: 412 |
|
| |
|
|
| 03 Jul 2014 12:22 PM |
keyz = {} mouse = game.Players.LocalPlayer:GetMouse() mouse.KeyDown:connect(function(K) keyz[K] = true--tells us that this key is held if keyz['a'] and keyz['z'] then--if both a and z are held down then print('b') end end) mouse.KeyUp:connect(function(K) keyz[K] = false--tells us the key is now up end) |
|
|
| Report Abuse |
|
|