ImSouls
|
  |
| Joined: 24 Feb 2015 |
| Total Posts: 803 |
|
|
| 17 Mar 2015 05:23 AM |
I'm not the best scripter (obviously), and I don't have a clue on how to edit this script to allow an xbox controller to take complete control over the character.
local Service = game:GetService("UserInputService")
Service.InputBegan:connect(function(input, recieved) if input.UserInputType == Enum.UserInputType.Gamepad1 then if input.KeyCode == Enum.KeyCode.ButtonX then print('Input ButtonX') elseif input.KeyCode == Enum.KeyCode.ButtonY then print('Input ButtonY') elseif input.KeyCode == Enum.KeyCode.ButtonA then print('Input ButtonA') elseif input.KeyCode == Enum.KeyCode.ButtonB then print('Input ButtonB') elseif input.KeyCode == Enum.KeyCode.ButtonR1 then print('Input ButtonR1') elseif input.KeyCode == Enum.KeyCode.ButtonL1 then print('Input ButtonL1') elseif input.KeyCode == Enum.KeyCode.ButtonR2 then print('Input ButtonR2') elseif input.KeyCode == Enum.KeyCode.ButtonL2 then print('Input ButtonL2') elseif input.KeyCode == Enum.KeyCode.ButtonR3 then print('Input ButtonR3') elseif input.KeyCode == Enum.KeyCode.ButtonL3 then print('Input ButtonL3') elseif input.KeyCode == Enum.KeyCode.ButtonStart then print('Input ButtonStart') elseif input.KeyCode == Enum.KeyCode.ButtonSelect then print('Input ButtonSelect') elseif input.KeyCode == Enum.KeyCode.DPadLeft then print('Input DPadLeft') elseif input.KeyCode == Enum.KeyCode.DPadRight then print('Input DPadRight') elseif input.KeyCode == Enum.KeyCode.DPadUp then print('Input DPadUp') elseif input.KeyCode == Enum.KeyCode.DPadDown then print('Input DPadDown') elseif input.KeyCode == Enum.KeyCode.Thumbstick1 then print('Input Thumbstick1') elseif input.KeyCode == Enum.KeyCode.Thumbstick2 then print('Input Thumbstick2') end end end)
Roblox deleted my post count, add 5,300+ posts. R$488 Tx0 RAP: 24,680 |
|
|
| Report Abuse |
|
|
|
| 17 Mar 2015 07:58 AM |
the prints do Work right?
"My Life is going Good... but..." |
|
|
| Report Abuse |
|
|
ImSouls
|
  |
| Joined: 24 Feb 2015 |
| Total Posts: 803 |
|
|
| 17 Mar 2015 12:53 PM |
Yes, when I press buttons on my xbox controller, the prints show the buttons I press in the output
Roblox deleted my post count, add 5,300+ posts. R$524 Tx24 RAP: 24,986 |
|
|
| Report Abuse |
|
|
|
| 17 Mar 2015 12:57 PM |
then after each print do something...
print('Pressed A') char.Torso.Velocity = Vector3.new(0, 50, 0) --Assuming that char is defined...
"My Life is going Good... but..." |
|
|
| Report Abuse |
|
|
ImSouls
|
  |
| Joined: 24 Feb 2015 |
| Total Posts: 803 |
|
|
| 17 Mar 2015 01:00 PM |
How exactly do I define char?
Roblox deleted my post count, add 5,300+ posts. R$524 Tx24 RAP: 24,986 |
|
|
| Report Abuse |
|
|
|
| 17 Mar 2015 01:05 PM |
well if this is in a LocalScript then
char = game.Players.LocalPlayer
"My Life is going Good... but..." |
|
|
| Report Abuse |
|
|
LucasLua
|
  |
| Joined: 18 Jun 2008 |
| Total Posts: 7386 |
|
|
| 17 Mar 2015 01:05 PM |
| You want us to code the character movement for you...? |
|
|
| Report Abuse |
|
|
|
| 17 Mar 2015 01:07 PM |
| If you are testing right now, make a part in workspace as your test example. If you can figure out how to move your test part, you should be able figure out everything else. |
|
|
| Report Abuse |
|
|
ImSouls
|
  |
| Joined: 24 Feb 2015 |
| Total Posts: 803 |
|
|
| 17 Mar 2015 01:17 PM |
Lucas, it's more of a project that could help towards learning how to script other things in the future. And I don't NEED you to rewrite the script to make my character move (lol), I could possibly try finding it out on my own. So technically, you guys are teaching me stuff about scripting by giving me small parts to work with when it comes to complicated scripts.
Roblox deleted my post count, add 5,300+ posts. R$524 Tx24 RAP: 24,986 |
|
|
| Report Abuse |
|
|
ImSouls
|
  |
| Joined: 24 Feb 2015 |
| Total Posts: 803 |
|
|
| 17 Mar 2015 01:21 PM |
Idk if that made any sense, I just woke up I have no clue what I'm talking about lol. This is the output when I defined char - "11:18:42.966 - Torso is not a valid member of Player" Am I doing something wrong? This script is indeed a LocalScript, and it's in StarterGui.
Roblox deleted my post count, add 5,300+ posts. R$524 Tx24 RAP: 24,986 |
|
|
| Report Abuse |
|
|
|
| 17 Mar 2015 01:26 PM |
sry... forgot... .Character at the end of LocalPlayer
"My Life is going Good... but..." |
|
|
| Report Abuse |
|
|
ImSouls
|
  |
| Joined: 24 Feb 2015 |
| Total Posts: 803 |
|
|
| 17 Mar 2015 01:32 PM |
Thanks a bunch for the help, Kapitanovas.
Roblox deleted my post count, add 5,300+ posts. R$524 Tx24 RAP: 24,986 |
|
|
| Report Abuse |
|
|
|
| 17 Mar 2015 01:34 PM |
np ;)
"My Life is going Good... but..." |
|
|
| Report Abuse |
|
|
ImSouls
|
  |
| Joined: 24 Feb 2015 |
| Total Posts: 803 |
|
|
| 17 Mar 2015 02:07 PM |
OK, so now pressing A makes me jump. But when I repeatedly press A in the air, I keep jumping. How to fix?
Roblox deleted my post count, add 5,300+ posts. R$524 Tx24 RAP: 24,986 |
|
|
| Report Abuse |
|
|
|
| 17 Mar 2015 03:00 PM |
u see the part with char.Torso.Velocity = Vector3.new(0, 50, 0) try inserting this Line before char.Torso.Velocity = Vector3.new(0, -50, 0) and then after it wait(.1) and only then insert the Line I gave u 1st (the one with 50, not -50)
btw, could u take a Vid of how the Person Jumps with those? never seen those Numbers in Action XD I might think that those Numbers are too Small or too Big by the Performance of the Jump...
"My Life is going Good... but..." |
|
|
| Report Abuse |
|
|