#Full Capacity System not working properly(Pop-up shows up but inc is never set to 0)

1 messages · Page 1 of 1 (latest)

hidden grail
#
local inc=1
blockRemoveEvent.OnServerEvent:Connect(function(player,block)
    local incrementValue=player:WaitForChild('hitStrength')
    inc=incrementValue.Value
    local blocks=player.leaderstats.blocks
    local gems=player.leaderstats.gems
    if block.Parent==workspace:WaitForChild('MineParts') then
        for i,v in pairs(blockTypes) do
            if block.Name==v.BlockName then
                local hits=block:FindFirstChild('hits')
                local hitsShow=player:WaitForChild('PlayerGui'):WaitForChild('ScreenGui'):WaitForChild('Hits')
                local capacity=player:FindFirstChild('capacity')
                local playerHits=player:FindFirstChild('hits')
                hits.Value-=inc
                playerHits.Value+=inc
                if playerHits.Value>=capacity.Value then
                    game:GetService('ReplicatedStorage').fullEvent:FireClient(player)
                    inc=0
                else
                    inc=incrementValue.Value
                    
                end```
Idk what im doing wrong this used to work before i made a pickaxe upgrade shop but they are defo not connected so i mustve just fucked up somewhere
olive tulip
hidden grail
#

i can try printing the value to see but what would i have to do then

olive tulip
#

Basically, what is “inc”

hidden grail
#

its just those lines i want it to stay at 0 until u sell and capacity>hits

hidden grail
#

incrementation or whatever

olive tulip
#

Increment just means “an increase or addition”

hidden grail
#

yes basically that

olive tulip
#

Or just don’t give the player shit

hidden grail
#

its a mining sim

#

i wont just take their pickaxe away

#

i set the inc to 0 so they cant mine

olive tulip
olive tulip
hidden grail
#

like ? thats just what most games do, only thing i could think of is the pickaxe breaking but that would get annoying

hidden grail
#

oh shit i thought u meant change the whole system

#

yeah ill try that

olive tulip
#

Way easier than “dealing 0 damage”, just don’t deal anything

hidden grail
#

well thank you sir