|
| 15 Sep 2014 05:29 PM |
function speedgear(key) if key == "e" and script.Parent.GearLevel.Value ~= 5 then script.Parent.GearLevel.Value = script.Parent.GearLevel.Value+1 elseif key == "q" and script.Parent.GearLevel.Value ~= 0 then script.Parent.GearLevel.Value = script.Parent.GearLevel.Value-1 end end
So basically whenever I press a key it thinks its q and subtracts one?
Any key I press. |
|
|
| Report Abuse |
|
|
|
| 15 Sep 2014 05:51 PM |
I fixed what I could find, but I don't see your problem. Your problem is probably not in this section of code.
function SpeedGear(Key) if Key:lower() == "e" and script.Parent.GearLevel.Value <= 4 then script.Parent.GearLevel.Value = script.Parent.GearLevel.Value + 1 elseif Key:lower() == "q" and script.Parent.GearLevel.Value >= 1 then script.Parent.GearLevel.Value = script.Parent.GearLevel.Value - 1 end end |
|
|
| Report Abuse |
|
|
| |
|
Bobobob12
|
  |
| Joined: 23 Jan 2008 |
| Total Posts: 5350 |
|
|
| 15 Sep 2014 06:05 PM |
| post where speedgear is called |
|
|
| Report Abuse |
|
|
|
| 15 Sep 2014 06:20 PM |
As this is connected to my old script
function test(hit) if game.Players:GetPlayerFromCharacter(hit.Parent) then local speed1 = math.floor(script.Parent.Velocity.magnitude) test1 = true player = game.Players:GetPlayerFromCharacter(hit.Parent) mouse = player:GetMouse() speed() gear() mouse.KeyDown:connect(speedgear) end end
Gets called through my test function which is ran by script.Parent.Touched:connect(test) |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|