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

Am i comparing a number to an instance?

so i've made the following code

local starterRebirthAmount = 5000

replicatedStorage.Remotes.Rebirth.OnServerInvoke = function(player)

if not remoteData:FindFirstChild(player.name) then return "NoFolder"  end

local rebirths = player.leaderstats.Rebirths

if  player.leaderstats.Rebirths >= ( math.floor((starterRebirthAmount + (rebirths.Value) * math.sqrt(5000000))))then
	rebirths.Value = rebirths.Value + 1
	
	player.leaderstats.Magic.Value = 0
	
	player:LoadCharacter()

the starterRebirthAmount is a number and so is rebirths.Value, how can one of them be an instace

Sorry by my english it's not my mother language

1 comment

0

You forgot to reference the Value of rebirths, and why in the world would you need the square root of five million??

1 answer

Don't worry, we all make mistakes.

You forgot to put the ".Value" thing in the if statement, so that's why you're comparing a number and an instance. Also, is your auto indent on? If not, put the "end" word on the bottom of the if statement.

if not remoteData:FindFirstChild(player.name) then return "NoFolder"  end

local rebirths = player.leaderstats.Rebirths

if  player.leaderstats.Rebirths.Value >= ( math.floor((starterRebirthAmount + (rebirths.Value) * math.sqrt(5000000))))then
    rebirths.Value = rebirths.Value + 1

    player.leaderstats.Magic.Value = 0

    player:LoadCharacter()
end -- don't forget to put it

Have a nice day! I gotta go do some work.

1 comment

0

Oh god, i'm the dumbest person in the world, it was that simple to solve, thank you very much

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