Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

IntValue not being updated?

Asked by 4 years ago

This question has been solved by the original poster.

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)
0
What is firing the dumbbell event? MmadProgrammer 35 — 4y
0
Add a print to see if it’s even receiving the event MmadProgrammer 35 — 4y
0
nvm i fixed it baba7860 7 — 4y

1 answer

Log in to vote
0
Answered by
Despayr 505 Moderation Voter
4 years ago

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

0
Nice catch. royaltoe 5144 — 4y
Ad

Answer this question