local ATM = script.Parent

debounce = false

ATM.Touched:connect(function(entity)

    if entity.Parent.Name == "WaterEssence" and debounce == false then

        debounce = true

        local Man =  entity.Parent.Parent.Parent

        local player = game.Players:GetPlayerFromCharacter(Man)

        local EXP = player.leaderstats:FindFirstChild("EXP")

        EXP.Value = EXP.Value + 100

        print(EXP.Value) 

        wait(1)                   

        debounce = false

     end

  end)

Whats my error? it should give EXP when touched with WaterEssence, but it isnt doing it.

5 comments

0

What's the error? Please tell me so that I may be able to help. It looks fine to me. Take a screenshot or tell me what it says in the output.

0

try putting a print on line 6 with print(entity:GetFullName()) and see what comes in the output.

0

"Whats my error?" Yea, what IS the error?

0

the 'not' operator is a thing, by the way. check it out.

0

I'm pretty sure that entity.Parent.Name is not what you think it is