My script thinks 1 is a increment of 20

So I’m trying to make this roblox fishing rod script with rarity is based how much a guy fished. I’ve tried redoing the rarity part but it thinks that Value.Full which is set to 1 is a increment of 20 which is Config.Server.RarityModeConfig.Increment.Full.VeryRare. I’ve tried using IncrementOf(1,20)
It returned false but for some reason when i use variables/values it thinks there true.

Part of the script that doesn’t work

function IncrementOf(valtocheck,inc)
	local valueToCheck = valtocheck

	if valueToCheck % inc == 0 then
		return true
	else
		return false
	end
end
if IncrementOf(Full.Value,Config.Server.RarityModeConfig.Increment.Full.VeryRare)==true then
			print(IncrementOf(Full.Value,Config.Server.RarityModeConfig.Increment.Full.VeryRare))
			MoneyVal.Value=MoneyVal.Value+Config.Server.Prices.Rare
			remotes.FishInfo:InvokeClient(plr,GetRandomFish(3),Config.Server.Prices.VeryRare)
		elseif IncrementOf(Full.Value,Config.Server.RarityModeConfig.Increment.Full.VeryRare)==false then
			MoneyVal.Value=MoneyVal.Value+Config.Server.Prices.Common
			remotes.FishInfo:InvokeClient(plr,GetRandomFish(1),Config.Server.Prices.Common)
			print('got common')
		end

here’s the link to the model (the server side would be too long to paste) Note you need a leaderstat value called Cash

Are you sure Full.Value is 1? How are you setting the value for Full?

1%20 always equals 1

1 Like

Nvm I fixed it there was this bug were Full.Value always was zero fixed it now

1 Like

Glad I could help you figure this out! :slight_smile:

1 Like

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