I have a quick question, why is this not adding the tag to the player.
After doing further debug the player does have the correct cash amount (I do have a second script adding tags for other stuff, i dont think this is a problem)
Maybe its because the person already has a tag?
ServerScript
ChatService.SpeakerAdded:Connect(function(PlrName)
local Speaker = ChatService:GetSpeaker(PlrName)
Speaker:SetExtraData('Tags', {{TagText = "100K GOAT", TagColor = Color3.fromRGB(44, 0, 251)}})
if Players[PlrName].leaderstats.Cash.Value >= 100000 and Players[PlrName].leaderstats.Cash.Value < 1000000 then
Speaker:SetExtraData('Tags', {{TagText = "100K GOAT", TagColor = Color3.fromRGB(255, 0, 251)}})
else if Players[PlrName].leaderstats.Cash.Value >= 1000000 and Players[PlrName].leaderstats.Cash.Value < 10000000 then
Speaker:SetExtraData('Tags', {{TagText = "1M GOAT", TagColor = Color3.fromRGB(255, 6, 118)}})
else if Players[PlrName].leaderstats.Cash.Value >= 10000000 and Players[PlrName].leaderstats.Cash.Value < 100000000 then
Speaker:SetExtraData('Tags', {{TagText = "10M GOAT", TagColor = Color3.fromRGB(255, 0, 0)}})
else if Players[PlrName].leaderstats.Cash.Value >= 100000000 then
Speaker:SetExtraData('Tags', {{TagText = "100M GOAT", TagColor = Color3.fromRGB(255, 255, 255)}})
end
end
end
end
end)
You can see my test above were theres no if statement and even that fails
Youāre using elseif and the first if statement has the lowest amount. Because of this, all players who are OVER 100k will get the 100k tag only. The 1m,10m,100m, will only run when a player has LESS than 100k. I suggest you reverse the order, starting from if player has more than 100m, 10m, etc.
if playerr >= 100m then
--set tag
elseif player >= 10m then
--set tag
elseif player >= 1m then
--set tag
elseif player >= 100k then
--set tag
end