This is suppose to detect your value and if its true it changes the damage of or speed of the weapon. Ill give an example of what i attempt.
The Error i get is: attempt to compare nil with a number. The line i get the error is:
1 | if LeftButtonDownTime and currTime - LeftButtonDownTime > Start(THROW) and --WHATS WRONG? |
2 | currTime - LeftButtonDownTime < 1.15 then |
3 | ThrowAttack() |
01 | function Start() |
02 | if Game.Players.LocalPlayer.PlayerGui.Default.Value = = true then |
03 | SLASH_DAMAGE = 25 |
04 | DOWNSTAB_DAMAGE = 25 |
05 | Damage = 25 |
06 | SPEED = 85 |
07 | THROW = 0.38 |
08 | elseif Game.Players.LocalPlayer.PlayerGui.Upgrade 2. Value = = true then |
09 | SLASH_DAMAGE = 30 |
10 | elseif Game.Players.LocalPlayer.PlayerGui.Upgrade 3. Value = = true then |
11 | DOWNSTAB_DAMAGE = 30 |
12 | elseif Game.Players.LocalPlayer.PlayerGui.Upgrade 4. Value = = true then |
13 | Damage = 30 |
14 | elseif Game.Players.LocalPlayer.PlayerGui.Upgrade 5. Value = = true then |
15 | SPEED = 100 |
1 | --EXAMPLE: |
2 | function Blow(hit) |
3 | if Attacking then |
4 | BlowDamage(hit, Start(Damage)) --IS THIS RIGHT? |
5 | end |
6 | end |
THEIR ARE MORE FUNCTIONS BUT I JUST GAVE YOU AND EXAMPLE!
I think elseif negates the original if statement. elseif will do something if the first condition is not met so I think your
~~~~~~~~~~~~~~~~~ elseif Game.Players.LocalPlayer.PlayerGui.Upgrade2.Value == true then
SLASH_DAMAGE = 30
~~~~~~~~~~~~~~~~~ only sets SLASH_DAMAGE and not the other values as well.