|
| 13 Jun 2014 11:32 AM |
How to make it where when somebody presses r,a,i,n they fly. _______Presses not Says |
|
|
| Report Abuse |
|
|
|
| 13 Jun 2014 11:48 AM |
Make sure the script is in startergui and is local! Try this.
player = game.Players.LocalPlayer char = player.Character mouse = player:GetMouse()
function onKeyDown(key) key:lower() if key == "r" then if key =="a" then if key == "i" then if key == "n" then end end end end end
mouse.KeyDown:connect(onKeyDown)
-You don't make the script. The script makes you.- |
|
|
| Report Abuse |
|
|
|
| 13 Jun 2014 04:43 PM |
So like for example Scythe script would it be in Startergui or in workspace. Or would the cheat codes script be in startergui?
|
|
|
| Report Abuse |
|
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
|
| 13 Jun 2014 04:57 PM |
It doesn't work!
HELP PLEASE!!!!!!!!!!!!!!
(I rage alot) |
|
|
| Report Abuse |
|
|
| |
|
CrniOrao
|
  |
| Joined: 12 Oct 2008 |
| Total Posts: 2274 |
|
|
| 13 Jun 2014 06:36 PM |
| It works, you just have to code functions to the keys yourself.. |
|
|
| Report Abuse |
|
|
Vuva
|
  |
| Joined: 22 Jan 2010 |
| Total Posts: 1102 |
|
|
| 13 Jun 2014 06:38 PM |
Well it will kinda work, except that: "key:lower()" should be: "key=key:lower()" |
|
|
| Report Abuse |
|
|
|
| 13 Jun 2014 06:40 PM |
mouse = game.Players.LocalPlayer:GetMouse()
mouse.KeyDown:connect(function(key) if key:lower() == "r" then mouse.KeyDown:connect(key) if key:lower() == "a" then mouse.KeyDown:connect(key) if key:lower() == "i" then mouse.KeyDown:connect(key) if key:lower() == "n" then --stuff end end) wait(1) end end) wait(1) end end) wait(1) end end)
most likely will not work but try atleast :l |
|
|
| Report Abuse |
|
|
CrniOrao
|
  |
| Joined: 12 Oct 2008 |
| Total Posts: 2274 |
|
|
| 13 Jun 2014 06:45 PM |
I think this is a proper way, just use a hopperbin, I think.
function keydown(mouse,k) key = string.lower(k) if (key == "r") then -- Executes when R is clicked. end if (key == "a") then -- Executes when A is clicked. end if (key == "i") then -- Executes when I is clicked. end if (key == "n") then -- Executes when N is clicked. end
function selected(mouse) mouse.KeyDown:connect(function(key) keydown(mouse,key) end) end
script.Parent.Selected:connect(selected) end |
|
|
| Report Abuse |
|
|
|
| 13 Jun 2014 07:20 PM |
| So I put the script inside the tool I want to execute when r,a,i,n is pressed? |
|
|
| Report Abuse |
|
|
|
| 13 Jun 2014 07:38 PM |
.-. >Localscript in StarterGui
Mouse = game.Players.localPlayer:GetMouse() Keys = {} Mouse.KeyDown:connect(function(Key) Keys[Key] = true if Keys["f"] and Keys["l"] and Keys["y"] then print("Fly Enabled") end end) Mouse.KeyUp:connect(function(Key) Keys[Key] = false end) |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 13 Jun 2014 07:38 PM |
It's amazing how either you are all wrong or you have no idea what he is talking about. I know this is not the best way to go about it but something like this should work:
local pressed = {}; local cheats = { ["rain"] = function() whatever end; };
local check = function() local cheatEntered = table.concat(pressed, ""); for cheat, func in next, cheats do if cheatEntered == cheat then func(); break; end end end;
mouse.KeyDown:connect(function(key) pressed[#pressed + 1] = key; check(); end); |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 13 Jun 2014 07:39 PM |
| Also, you might want to clear the table after the func() or whatever |
|
|
| Report Abuse |
|
|
|
| 13 Jun 2014 07:45 PM |
KeyDown won't capture i and probably some other keys Use KeyUp instead |
|
|
| Report Abuse |
|
|
|
| 13 Jun 2014 08:04 PM |
| How do I USE it like a video how to use it. |
|
|
| Report Abuse |
|
|
|
| 13 Jun 2014 08:23 PM |
| You clearly don't know how to script and should stop asking for things to be created for you. |
|
|
| Report Abuse |
|
|
|
| 13 Jun 2014 08:25 PM |
| Yeah why are you guys even helping this idiot? |
|
|
| Report Abuse |
|
|
|
| 13 Jun 2014 08:27 PM |
I am "Asking" You people because I infact do not know how to script. Am I the idiot or you?I am just asking if you can make me a script that does that. I am not an idiot who spams to think they are getting OBC or a free account.So infact you are the noob. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 13 Jun 2014 08:28 PM |
| We're all stupid, stop replying |
|
|
| Report Abuse |
|
|
|
| 13 Jun 2014 08:30 PM |
I am just asking if you can make me a script that does that. Read this sub-forum description and weep. Found here in case you're blind. http://puu.sh/9svQH/bde59faa4d.png No request. This place is for help with debugging code.
|
|
|
| Report Abuse |
|
|
|
| 14 Jun 2014 10:06 AM |
"This is a place to share your scripting skills and help others." Yeah you are really helping me by saying I am a noob.Yeah BIG help. If it said NO request then why is this thread still up? |
|
|
| Report Abuse |
|
|
|
| 14 Jun 2014 10:07 AM |
| @Josh:If I am an idiot why are you even posting on this thread? |
|
|
| Report Abuse |
|
|
maxomega3
|
  |
| Joined: 11 Jun 2010 |
| Total Posts: 10668 |
|
|
| 14 Jun 2014 10:10 AM |
"So infact you are the noob." "Yeah you are really helping me by saying I am a noob" only you called anyone a "noob"
get out pls. |
|
|
| Report Abuse |
|
|