Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

	local event = Instance.new("RemoteEvent")
		event.Parent = game.ReplicatedStorage
	event.Name = "Level"
local player = game:GetService("Players")
game.ReplicatedStorage.Level.OnServerEvent:connect(function(player)
	local PStats = player:WaitForChild("PStats")
	local Layer = PStats.Layer
	local TLayer = PStats.TLayer
	if Layer.Value < 10000 and TLayer.Value ~= 0 
	or Layer.Value < 20000 and TLayer.Value ~= 1 or
	 Layer.Value < 40000 and TLayer.Value ~=2 or
	  Layer.Value < 200000 and TLayer.Value ~= 3 or 
	   Layer.Value < 400000 and TLayer.Value ~=4 or
	    Layer.Value < 300000 and TLayer.Value ~= 5
	then
		print "Not Worthy!"
	else
		if Layer.Value >= 10000 and TLayer.Value == 0 
	or Layer.Value >= 20000 and TLayer.Value == 1 or
	  Layer.Value >= 40000 and TLayer.Value ==2 or
	  Layer.Value >= 200000 and TLayer.Value == 3 or 
	   Layer.Value >= 400000 and TLayer.Value ==4 or
	     Layer.Value >= 300000 and TLayer.Value == 5
	then
print "Worthy"
	
Layer.Value = 1
TLayer.Value = TLayer.Value + 1
wait(.2)
	end
	end
end)


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

2 comments

0

Operator precedence, you might need some parentheses

0

Try printing your Layer and TLayer values, make sure those are what you think they are.

1 answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.