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
#Full Capacity System not working properly(Pop-up shows up but inc is never set to 0)
1 messages · Page 1 of 1 (latest)
I feel like inc does get set to 0. But just set back to “increment.Value” on the next time the func fires
i can try printing the value to see but what would i have to do then
Well I’ve no clue what you’re trying to achieve
Basically, what is “inc”
its just those lines i want it to stay at 0 until u sell and capacity>hits
That doesn’t explain shit
Increment just means “an increase or addition”
yes basically that
Why? If the capacity is full then just don’t let the player attack
Or just don’t give the player shit
its a mining sim
i wont just take their pickaxe away
i set the inc to 0 so they cant mine
You can still make it ineffective
In a better way*
like ? thats just what most games do, only thing i could think of is the pickaxe breaking but that would get annoying
if (full) then return end
No, just simply don’t run the lines that calculate and deal damage
Way easier than “dealing 0 damage”, just don’t deal anything
well thank you sir