Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

[ANSWERED] Why does the first IF work no matter what?

Asked by 6 years ago
Edited 6 years ago
01    local event = Instance.new("RemoteEvent")
02        event.Parent = game.ReplicatedStorage
03    event.Name = "Level"
04local player = game:GetService("Players")
05game.ReplicatedStorage.Level.OnServerEvent:connect(function(player)
06    local PStats = player:WaitForChild("PStats")
07    local Layer = PStats.Layer
08    local TLayer = PStats.TLayer
09    if Layer.Value < 10000 and TLayer.Value ~= 0
10    or Layer.Value < 20000 and TLayer.Value ~= 1 or
11     Layer.Value < 40000 and TLayer.Value ~=2 or
12      Layer.Value < 200000 and TLayer.Value ~= 3 or
13       Layer.Value < 400000 and TLayer.Value ~=4 or
14        Layer.Value < 300000 and TLayer.Value ~= 5
15    then
View all 32 lines...

The issue is that no matter what it only prints not worthy

0
Operator precedence, you might need some parentheses User#24403 69 — 6y
0
Try printing your Layer and TLayer values, make sure those are what you think they are. DinozCreates 1070 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

@Incapaxian Answered this, I can't put him to answer though so here is this post

Ad

Answer this question