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
xAvrice
(avrice)
2
I think playerCoins is a string here. You could do print(typeof(playerCoins)) to double check.
epaes
(epaes)
3
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
epaes
(epaes)
4
or maybe you forgot to add the .Value in playerCoins, so it would be like this:
elseif playerCoins.Value >= boatCost then
system
(system)
Closed
5
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.