Why is If statement is being ignored?
Asked by
4 years ago Edited 4 years ago
I have a very simple question, why my If statement is not working after -If Jugador ~= nil then-, after this the next If statement (if Jugador.Valor.Value > 999 then) is not working but if I put another code for example Jugador.Valor.Value = Jugador. Valor.Value - 1000 without the -If Jugador.Valor.Value > 999 then- it works.
PD: The output shows no errors or warnings.
01 | local upgrader = workspace.Upgraders.Upgrader 1 |
02 | local bean = upgrader.Bean |
04 | script.Parent.Touched:Connect( function (Part) |
05 | if Part.Parent:FindFirstChild( "Humanoid" ) then |
06 | local Jugador = game.Players:GetPlayerFromCharacter(Part.Parent) |
07 | if Jugador ~ = nil then |
08 | if Jugador.Valor.Value > 999 then |
09 | Jugador.Valor.Value = Jugador.Valor.Value - 1000 |
10 | upgrader.Transparency = 0 |
11 | upgrader.CanCollide = true |
12 | bean.Transparency = 0.7 |
13 | workspace.Upgraders.Upgrader 1. Bean.upgradeador 1. Disabled = false |