I am new to roblox scripting so don't judge. So I am trying to make a tapping simulator type game. I am right now trying to get the rebirth mechanic to work. but when I click the rebirth button I get this error thrown at me: Workspace.getRebirth:3: attempt to compare number and boolean
Here is the script.
script.getrebirth.OnServerEvent:Connect(function(plr) local leaderstats = plr:WaitForChild("leaderstats") if not leaderstats.Clicks.Value > 999 then end if leaderstats.Clicks.Value > 999 then leaderstats.Rebirths.Value = leaderstats.Rebirths.Value + 1 leaderstats.Clicks.Value = leaderstats.Clicks.Value - 1000 end end)
Please help ASAP.
✓ ANSWER ACCEPTED
Attempt to compare number or boolean???
1 answer
✓ Accepted answer
The line if not leaderstats.Clicks.Value > 999 then is erroring because the compiler thinks the left hand side not leaderstats.Clicks.Value is a boolean and the right hand side 999 is a number.
To fix this, remove "not" and replace > with <=
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Can you please format your post