#multi.Value = multi.Value + (reb.Value / 10)

1 messages · Page 1 of 1 (latest)

rapid hawk
#

multi.Value = multi.Value + (reb.Value / 10)
I'm so confused, what's wrong with this, it works fine but the reb.Value stuff doesn't work when adding /10

lunar lichen
#

bro waht

#

whats reb supposed to be

rapid hawk
#
    local multi = Instance.new("IntValue")
    multi.Name = "Multi"
    multi.Value = 98
    multi.Parent = stats

    local reb = Instance.new("IntValue")
    reb.Name = "Reb"
    reb.Value = 0
    reb.Parent = stats
    
lunar lichen
#

pretty sure you have to set reb to a value above 0

#

cus 0 / 10 isn't possible

rapid hawk
#

yeah i do that at one point in the code

        if multi.Value >= 100 then
            multi.Value = 1
            reb.Value += 1
        end
lunar lichen
#

try gaining one rebirth ingame

#

then

rapid hawk
# lunar lichen try gaining one rebirth ingame

yeah i did that,

game.Players.PlayerAdded:Connect(function(player)
    local stats = Instance.new("Folder")
    stats.Name = "Stats"
    stats.Parent = player

    local cash = Instance.new("IntValue")
    cash.Name = "Cash"
    cash.Value = 0
    cash.Parent = stats

    local multi = Instance.new("IntValue")
    multi.Name = "Multi"
    multi.Value = 98
    multi.Parent = stats

    local reb = Instance.new("IntValue")
    reb.Name = "Reb"
    reb.Value = 0
    reb.Parent = stats
    
    while true do
        wait(0.1)
        cash.Value = cash.Value + 9 + multi.Value
        multi.Value = multi.Value + (reb.Value / 10)
        if cash.Value >= 1000 then
            cash.Value = 0
            multi.Value += 1
        end
        if multi.Value >= 100 then
            multi.Value = 1
            reb.Value += 1
        end
    end
end)
``` i get 100 multi, get 1 rebirth where i should then start getting multi from my rebirth value / 10 where i do not
lunar lichen
#

okay try this:
if reb ~= 0 then
multi.Value = multi.Value + (reb.Value / 10)
else
multi.Value = multi.Value
end

rapid hawk
lunar lichen
#

did you replace multi.Value = multi.Value + (reb.Value / 10) with what i said?

rapid hawk