Cant divide IntValue

I have a script where whenever an event is fired I get rebirth value * 0.1 added to a MaxHealth IntValue but the problem is that the rebirth value isnt getting divided and stops working, the script is below

local event = game.ReplicatedStorage.Pushup
local debounce = false


event.OnServerEvent:Connect(function(player)
	local leaderstats = player.leaderstats
	local MogPoints = leaderstats.MogPoints
	local MewStrength = leaderstats.MewStrength
	local Character = player.Character
	if debounce == false then
		debounce = true
		player.leaderstats.MaxHealth.Value += (leaderstats:WaitForChild("MewStrength").Value * 0.1)
		wait(0.15)
		debounce = false
	end
end)

IntValue(s) are limited to integers which are whole numbers. Only whole positive or negative numbers only.

2 Likes

As @anon81993163 mentioned, you cannot assign a non int value (a float) to an integer value. Just switch the integer value objects to number value objects and it should work

so instead of * 0.1 I should put / 10 right?

Replace IntValue to NumberValue, it should work

1 Like

thanks it worked

30 letterwssssss

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