How to fix this error

Hey everyone, Dose anyone know how I can fix this error I am out of ideas

This is the error

Players.BadKarmas_YT.PlayerGui.GUI.Frames.Boats.BoatsFrame.LocalScript:93: attempt to compare number <= string

An here is the code im having trouble with

elseif playerCoins >= boatCost then

I think playerCoins is a string here. You could do print(typeof(playerCoins)) to double check.

Maybe one of them is a string, try using the funcion tonumber(), to convert any string to a number if it is.

elseif tonumber(playerCoins) >= tonumber(boatCost) then

or maybe you forgot to add the .Value in playerCoins, so it would be like this:

elseif playerCoins.Value >= boatCost then

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.