How do i make these 2 compatible?
function loadScore2(player, clickCounter) local score = player:LoadNumber("DevilFruit") if score ~= 0 then clickCounter.Value = score else print("Nothing to load/score was 0") end end
local clicks2 = Instance.new("StringValue") clicks2.Name = "DevilFruit" clicks2.Value = ""
Numbers and strings are already compatible, what you have there is fine.
Although, you can use tostring()
and tonumber()
.
Note: This may not answer your question, but I will put a code block with another possible answer under it.
Script:
function loadScore2(player, clickCounter) local clicks2 = Instance.new("StringValue") clicks2.Name = "DevilFruit" clicks2.Value = "" local score = player:LoadNumber("DevilFruit") if score ~= 0 then clicks2.Value = score else print("Nothing to load/score was 0") end end
Tip
Don't use spaces for code, use tab. Tab is faster, and easier. E.G:
if blah then -- oke end --vs tab: if blah then -- oke end
Hard to see difference, but it's better