Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

IntValue not being updated?

So, I have leaderstats, and I did in a server script is add the points in but it wouldnt work? It doesnt even output any errors?

Code:

dumbellEvent.OnServerEvent:Connect(function(plr)
	local leaderstats = plr.leaderstats
	if leaderstats then
		local damage = leaderstats.Damage
		if damage then
			damage.Value = damage.Value +0.1
			print(damage.Value)
		end
	end
end)

3 comments

0

What is firing the dumbbell event?

0

Add a print to see if it’s even receiving the event

0

nvm i fixed it

1 answer

✓ Accepted answer

You are using an IntValue, which can only be an 'Integer'. (A Whole Number)

What you are looking for is a fraction (going by how you are trying to increment the value by .1)

To fix this, you can change the Integer value to a number value

1 comment

0

Nice catch.

This discussion is preserved as it was. New answers, comments, and votes are closed.