Elseif Not Working

Hello, I am working on a division system, its 3AM and nothing is working for me, please help!


game.Players.PlayerAdded:Connect(function(player)
	
	if game.Players.LocalPlayer.leaderstats.Wins.Value > 0 then
		script.Parent.Text = "CURRENT DIVISION: ".. "ROOKIE"
		elseif
		if game.Players.LocalPlayer.leaderstats.Wins.Value > 24 then
		script.Parent.Text == "CURRENT DIVISION: ".. "PRO"
		elseif game.Players.LocalPlayer.leaderstats.Wins.Value > 48 then 
		script.Parent.Text == "CURRENT DIVISION: ".. "ELITE"
		elseif game.Players.LocalPlayer.leaderstats.Wins.Value > 88 then 
		script.Parent.Text == "CURRENT DIVISION: ".. "MASTER" 
		elseif game.Players.LocalPlayer.leaderstats.Wins.Value > 125 then 
		script.Parent.Text == "CURRENT DIVISION: ".. "GRANDMASTER"
		elseif game.Players.LocalPlayer.leaderstats.Wins.Value > 250 then 
		script.Parent.Text == "CURRENT DIVISION: ".. "CHAMPION FINALS" 
		else
		print("halal mode") then
	end
	end)

Try this, If its inside a text, Make sure its in local script


	if game.Players.LocalPlayer.leaderstats.Wins.Value > 0 then
		script.Parent.Text = "CURRENT DIVISION: ".. "ROOKIE"
	elseif game.Players.LocalPlayer.leaderstats.Wins.Value > 24 then
		script.Parent.Text = "CURRENT DIVISION: ".. "PRO"
	elseif game.Players.LocalPlayer.leaderstats.Wins.Value > 48 then 
		script.Parent.Text = "CURRENT DIVISION: ".. "ELITE"
	elseif game.Players.LocalPlayer.leaderstats.Wins.Value > 88 then 
		script.Parent.Text = "CURRENT DIVISION: ".. "MASTER" 
	elseif game.Players.LocalPlayer.leaderstats.Wins.Value > 125 then 
		script.Parent.Text = "CURRENT DIVISION: ".. "GRANDMASTER"
	elseif game.Players.LocalPlayer.leaderstats.Wins.Value > 250 then 
		script.Parent.Text = "CURRENT DIVISION: ".. "CHAMPION FINALS" 
	else
		print("halal mode")
	end

for the value put >=

example:

game.Players.LocalPlayer.leaderstats.Wins.Value >= 100 then -- continue from here 

for some reason the text wont change to it, im pretty sure its supposed to be a script

Follow what Ulric said,

Change > to >=

still not working


game.Players.PlayerAdded:Connect(function(player)
	while true do
		wait(1)
	
	if game.Players.LocalPlayer.leaderstats.Wins.Value >= 0 then
		script.Parent.Text = "CURRENT DIVISION: ".. "ROOKIE"
	elseif game.Players.LocalPlayer.leaderstats.Wins.Value >= 24 then
		script.Parent.Text = "CURRENT DIVISION: ".. "PRO"
	elseif game.Players.LocalPlayer.leaderstats.Wins.Value >= 48 then 
		script.Parent.Text = "CURRENT DIVISION: ".. "ELITE"
	elseif game.Players.LocalPlayer.leaderstats.Wins.Value >= 88 then 
		script.Parent.Text = "CURRENT DIVISION: ".. "MASTER" 
	elseif game.Players.LocalPlayer.leaderstats.Wins.Value >= 125 then 
		script.Parent.Text = "CURRENT DIVISION: ".. "GRANDMASTER"
	elseif game.Players.LocalPlayer.leaderstats.Wins.Value >= 250 then 
		script.Parent.Text = "CURRENT DIVISION: ".. "CHAMPION FINALS" 
	else
		print("halal mode")
		end
		end
end)

still not working


game.Players.PlayerAdded:Connect(function(player)
	while true do
		wait(1)
	
	if game.Players.LocalPlayer.leaderstats.Wins.Value >= 0 then
		script.Parent.Text = "CURRENT DIVISION: ".. "ROOKIE"
	elseif game.Players.LocalPlayer.leaderstats.Wins.Value >= 24 then
		script.Parent.Text = "CURRENT DIVISION: ".. "PRO"
	elseif game.Players.LocalPlayer.leaderstats.Wins.Value >= 48 then 
		script.Parent.Text = "CURRENT DIVISION: ".. "ELITE"
	elseif game.Players.LocalPlayer.leaderstats.Wins.Value >= 88 then 
		script.Parent.Text = "CURRENT DIVISION: ".. "MASTER" 
	elseif game.Players.LocalPlayer.leaderstats.Wins.Value >= 125 then 
		script.Parent.Text = "CURRENT DIVISION: ".. "GRANDMASTER"
	elseif game.Players.LocalPlayer.leaderstats.Wins.Value >= 250 then 
		script.Parent.Text = "CURRENT DIVISION: ".. "CHAMPION FINALS" 
	else
		print("halal mode")
		end
		end
end)
Put in local script
if game.Players.LocalPlayer.leaderstats.Wins.Value >= 0 then
		script.Parent.Text = "CURRENT DIVISION: ".. "ROOKIE"
	elseif game.Players.LocalPlayer.leaderstats.Wins.Value >= 24 then
		script.Parent.Text = "CURRENT DIVISION: ".. "PRO"
	elseif game.Players.LocalPlayer.leaderstats.Wins.Value >= 48 then 
		script.Parent.Text = "CURRENT DIVISION: ".. "ELITE"
	elseif game.Players.LocalPlayer.leaderstats.Wins.Value >= 88 then 
		script.Parent.Text = "CURRENT DIVISION: ".. "MASTER" 
	elseif game.Players.LocalPlayer.leaderstats.Wins.Value >= 125 then 
		script.Parent.Text = "CURRENT DIVISION: ".. "GRANDMASTER"
	elseif game.Players.LocalPlayer.leaderstats.Wins.Value >= 250 then 
		script.Parent.Text = "CURRENT DIVISION: ".. "CHAMPION FINALS" 
	else
		print("halal mode")
	end

is it a billboard gui if yes then u need a server script.

btw i need to go to school

its not working still its a normal textlabel

This should work:

game.Players.PlayerAdded:Connect(function(player)
	if player.leaderstats.Wins.Value > 0 and player.leaderstats.Wins.Value <= 23 then
		script.Parent.Text = "CURRENT DIVISION: ".. "ROOKIE"
	elseif player.leaderstats.Wins.Value >= 24 and player.leaderstats.Wins.Value <= 47 then
		script.Parent.Text = "CURRENT DIVISION: ".. "PRO"
	elseif player.leaderstats.Wins.Value >= 48 and player.leaderstats.Wins.Value <= 87 then 
		script.Parent.Text = "CURRENT DIVISION: ".. "ELITE"
	elseif player.leaderstats.Wins.Value >= 88 and player.leaderstats.WIns.Value <= 124 then 
		script.Parent.Text = "CURRENT DIVISION: ".. "MASTER" 
	elseif player.leaderstats.Wins.Value >= 125 and player.leaderstats.Wins.Value <= 249 then 
		script.Parent.Text = "CURRENT DIVISION: ".. "GRANDMASTER"
	elseif game.Players.LocalPlayer.leaderstats.Wins.Value > 250 then 
		script.Parent.Text = "CURRENT DIVISION: ".. "CHAMPION FINALS" 
	else
		print("halal mode") then
	end
end)

is it inside a script or localscript?

I don’t know, I just fixed your script

no you didnt, its not changing the text…

Probably u can’t acces PlayerAdded function from a LocalScript. Try this then

while wait(2) do
	if player.leaderstats.Wins.Value > 0 and player.leaderstats.Wins.Value <= 23 then
		script.Parent.Text = "CURRENT DIVISION: ROOKIE"
	elseif player.leaderstats.Wins.Value >= 24 and player.leaderstats.Wins.Value <= 47 then
		script.Parent.Text = "CURRENT DIVISION: PRO"
	elseif player.leaderstats.Wins.Value >= 48 and player.leaderstats.Wins.Value <= 87 then 
		script.Parent.Text = "CURRENT DIVISION: ELITE"
	elseif player.leaderstats.Wins.Value >= 88 and player.leaderstats.WIns.Value <= 124 then 
		script.Parent.Text = "CURRENT DIVISION: MASTER" 
	elseif player.leaderstats.Wins.Value >= 125 and player.leaderstats.Wins.Value <= 249 then 
		script.Parent.Text = "CURRENT DIVISION: GRANDMASTER"
	elseif game.Players.LocalPlayer.leaderstats.Wins.Value > 250 then 
		script.Parent.Text = "CURRENT DIVISION: CHAMPION FINALS" 
	else
		print("halal mode") then
	end
end

The problem was at the elseif.

local TestNumber = 1

if TestNumber >= 0 then
    print("TestNumber is larger than 0!")
elseif TestNumber >= 1 then
    print("TestNumber is larger than 1!")
end

Guess what it did? The output printed “TestNumber is larger than 0!”, but not “TestNumber is larger than 1!”? That’s because it checks on the first if statement, and if it’s valid, it skips to the end. What you should be doing is:

local TestNumber = 1

if TestNumber >= 0 then
    print("TestNumber is larger than 0!")
end

if TestNumber >= 1 then
    print("TestNumber is larger than 1!")
end

Printed “TestNumber is over 0!” and “TestNumber is over 1!”. You should not be doing elseif to reduce lines though. That’s not a shortcut, that’s a different mechanic that the developer hub didn’t cover well. Hope this helped!

Mind providing a screenshot of where the script is.

thanks, thats also another way to solve it, will take that in mind.

if the script is a descendant of a textlabel then

local player = game:GetService("Players")
local LocalPlayer = player.LocalPlayer
local leaderstats = LocalPlayer:WaitForChild("leaderstats")
local Wins = leaderstats:WaitForChild("Wins")
 print(leaderstats, wins) -- checks if these exists

local function division(wins)   
	if wins.Value > 0 then
		script.Parent.Text = "CURRENT DIVISION: ".. "ROOKIE"
	elseif wins.Value > 24 then
		script.Parent.Text == "CURRENT DIVISION: ".. "PRO"
	elseif wins.Value > 48 then 
		script.Parent.Text == "CURRENT DIVISION: ".. "ELITE"
	elseif wins.Value > 88 then 
		script.Parent.Text == "CURRENT DIVISION: ".. "MASTER" 
	elseif wins.Value > 125 then 
		script.Parent.Text == "CURRENT DIVISION: ".. "GRANDMASTER"
	elseif wins.Value > 250 then 
		script.Parent.Text == "CURRENT DIVISION: ".. "CHAMPION FINALS" 
	else
		print("halal mode")
	end
end

divisions(Wins.Value)
Wins.Changed:connect(function(value)
     divisions(value)
end

It is just a common mistake. Don’t forget: “>=” means equal or greater than so you were checking in the code from the first post if player’s wins were equal or greater than 0 instead of checking if it is less than the next division’s wins.

if game.Players.LocalPlayer.leaderstats.Wins.Value < 24 then
		script.Parent.Text = "CURRENT DIVISION: ".. "ROOKIE"
		elseif
		if game.Players.LocalPlayer.leaderstats.Wins.Value < 48 then
		script.Parent.Text == "CURRENT DIVISION: ".. "PRO"
		elseif game.Players.LocalPlayer.leaderstats.Wins.Value < 88 then 
		script.Parent.Text == "CURRENT DIVISION: ".. "ELITE"
		elseif game.Players.LocalPlayer.leaderstats.Wins.Value < 125 then 
		script.Parent.Text == "CURRENT DIVISION: ".. "MASTER" 
		elseif game.Players.LocalPlayer.leaderstats.Wins.Value < 250 then 
		script.Parent.Text == "CURRENT DIVISION: ".. "GRANDMASTER"
		elseif game.Players.LocalPlayer.leaderstats.Wins.Value >= 250 then 
		script.Parent.Text == "CURRENT DIVISION: ".. "CHAMPION FINALS" 
		end
        --else
		--print("halal mode") then
	end

Also yes, when the player joins they can’t recieve the PlayerAdded signal from server.