ajfg
|
  |
| Joined: 10 Mar 2013 |
| Total Posts: 37 |
|
|
| 19 Mar 2013 06:45 PM |
Before I say anything, I'm going to start off by saying that I am a COMPLETE newbie to scripting and this is also an alt that I'm too lazy to log out of.
Now... I'm making a game:
http://www.roblox.com/Somewhat-Modern-Blockfare-3-Dome-place?id=82979397
It's basically Dome from MW3.
I took Ubayla's Gun System (which is very glitchy...):
http://www.roblox.com/Gun-System-item?id=68031752
There's this one part in the script controlling the sprinting feature (I edited a value but that's all):
elseif key == "w" then if aiming == false and Reloading == false and throwing == false and swinging == false and Sprint > 0 then t = r.Stepped:wait() if (t - Double < 0) then sprinting = true welds[1].C0 = CFrame.new(-1, -1.5, -0.8) * CFrame.Angles(math.rad(50), 0, math.rad(-25)) welds[2].C0 = CFrame.new(0.4, -1.2, -0.4) * CFrame.Angles(math.rad(90), math.rad(25), math.rad(-50)) welds[3].C0 = CFrame.new(-1, -1.5, -0.8) * CFrame.Angles(math.rad(50), 0, math.rad(-25)) welds[4].C0 = CFrame.new(0.4, -1.2, -0.4) * CFrame.Angles(math.rad(90), math.rad(25), math.rad(-50)) crouching = false prone = false welds[6].Part1 = nil welds[7].Part1 = nil hi[1].Part1 = legs[1] hi[2].Part1 = legs[2] legs[1].Name = "Left Leg" legs[2].Name = "Right Leg" legs[1].CanCollide = false legs[2].CanCollide = false MinRecoil = MinRecoil + 0.1 Tool.Parent.Humanoid.WalkSpeed = 20 wait() Camera.FieldOfView = 72 wait() Camera.FieldOfView = 74 wait() Camera.FieldOfView = 76 wait() Camera.FieldOfView = 78 wait() Camera.FieldOfView = 80 end Double = t end
I want to change "w" to the shift key. I looked into CloneTrooper1019's Sprint Script and it says this:
mouse.KeyDown:connect(function (key) -- Run function key = string.lower(key) if string.byte(key) == 48 then running = true local keyConnection = mouse.KeyUp:connect(function (key) if string.byte(key) == 48 then running = false end end) for i = 1,5 do game.Workspace.CurrentCamera.FieldOfView = (70+(i*2)) wait() end game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 24 repeat wait () until running == false keyConnection:disconnect() game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 16 for i = 1,5 do game.Workspace.CurrentCamera.FieldOfView = (80-(i*2)) wait() end end end)
My question is: How can I get my game's gun to detect the Shift button? Should I try this?:
elseif string.byte(key) == 48 then
I don't want to save anything until I'm sure this will work.
Sorry for the long post! :( |
|
|
| Report Abuse |
|
|
ajfg
|
  |
| Joined: 10 Mar 2013 |
| Total Posts: 37 |
|
| |
|
ajfg
|
  |
| Joined: 10 Mar 2013 |
| Total Posts: 37 |
|
| |
|
ajfg
|
  |
| Joined: 10 Mar 2013 |
| Total Posts: 37 |
|
|
| 19 Mar 2013 06:59 PM |
I think I'm being ignored because I'm not including everything in the script that involves sprinting.
Eh. :/ |
|
|
| Report Abuse |
|
|
|
| 11 Jun 2014 06:35 PM |
| you need to change your attitude mister. You understand me? |
|
|
| Report Abuse |
|
|
Frantuary
|
  |
| Joined: 11 Jul 2012 |
| Total Posts: 11315 |
|
|
| 11 Jun 2014 06:47 PM |
read the rules
No arms, and you can still use a calculator! |
|
|
| Report Abuse |
|
|
|
| 17 Jul 2014 02:05 PM |
| I decided to ignore the scripts & tell you that the key for Shift should be "0." |
|
|
| Report Abuse |
|
|
|
| 17 Jul 2014 02:06 PM |
| Left Shift's byte code is 48 |
|
|
| Report Abuse |
|
|
|
| 17 Jul 2014 02:06 PM |
The code for the Shift key is "48," though.
http://wiki.roblox.com/index.php?title=Taking_keyboard_input#Special_keys |
|
|
| Report Abuse |
|
|
|
| 17 Jul 2014 02:06 PM |
| You HAVE to use UserInputService and check if InputObject.KeyCode == Enum.KeyCode.LeftShift or Enum.KeyCode.RightShift. |
|
|
| Report Abuse |
|
|
| |
|
|
| 17 Jul 2014 02:10 PM |
| Except so is 0. Using UserInputService is the only way to get Left/Right Ctrl/Alt/Shift, Caps, Tab, Escape, the F## keys, etc without conflicts. |
|
|
| Report Abuse |
|
|