local player = game.Players.LocalPlayer
local stats = player:WaitForChild("leaderstats")
local coins = stats:WaitForChild("Coins")
local rebirths = stats:WaitForChild("Rebirths")
while true do
wait()
if player.leaderstats.Rebirths.Value == 0 then
if player.leaderstats.Coins.Value >= 10000000 then
script.Parent.Text = "You Have Enough Coins To Rebirth!"
else
local required_coins = 10000000
script.Parent.Text = "Coins Needed: "..required_coins - player.leaderstats.Coins.Value
end
elseif player.leaderstats.Rebirths.Value >= 1 then
if player.leaderstats.Coins.Value >= 10000000 * player.leaderstats.Rebirths.Value * 3 then
script.Parent.Text = "You Have Enough Coins To Rebirth!"
else
script.Parent.Text = "Coins Needed: "..player.leaderstats.Coins.Value >= 10000000 * player.leaderstats.Rebirths.Value * 3 - player.leaderstats.Coins.Value
end
end
end
COMMUNITY QUESTION
attempt to compare number and string (line 20)?
0 answers
No public answers were preserved for this question.
This discussion is preserved as it was. New answers, comments, and votes are closed.

5 comments
It's definitely because you're trying to put >= in the string. As the error said you can't compare numbers in a string. Remove the >= sign and the number after that and your code should work.
It's definitely because you're trying to put >= in the string. As the error said you can't compare numbers in a string. Remove the >= sign and the number after that and your code should work.
It's definitely because you're trying to put >= in the string. As the error said you can't compare numbers in a string. Remove the >= sign and the number after that and your code should work.
It's definitely because you're trying to put >= in the string. As the error said you can't compare numbers in a string. Remove the >= sign and the number after that and your code should work.
Make sure coin is a number value and not a string value