So I have this code here
script.Parent.Touched:Connect(function(plr)
local humanoidcheck = plr.Parent:FindFirstChild("Humanoid")
if (humanoidcheck) then
local player = game.Players:GetPlayerFromCharacter(humanoidcheck.Parent);
if (player) then
local orbfolder = player.orbfolder
if orbfolder.orb1.Value == 0 then
local orbs = player.leaderstats.Orbs
orbs.Value = orbs.Value + 1
orbfolder.orb1.Value = 1
end
end
end
end)
Its all fine and dandy till the
if orbfolder.orb1.Value == 0 then
section where this if statement seems to only check once. I've tested this in studio setting it to 1 and it still gives it, and then after this i set it to zero and it doesnt award it. Im not sure whats going on here, any help is appreciated!

2 comments
From what I can see, it checks once, and then sets orbfolder.orb1.Value to 1, which is why the if statement is no longer true
Yes but the problem is if I go into testing mode and put 1 as the orb1 value in the player it still gives the darn thing. And if after it gives the orb, I set the value back to 0 it wont give again