Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Whats my error? Im completely sure it should be alright

Asked by 6 years ago
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.

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. ZenTGE 4 — 6y
0
try putting a print on line 6 with print(entity:GetFullName()) and see what comes in the output. RubenKan 3615 — 6y
0
"Whats my error?" Yea, what IS the error? steven73598233 75 — 6y
0
the 'not' operator is a thing, by the way. check it out. Fifkee 2017 — 6y
0
I'm pretty sure that entity.Parent.Name is not what you think it is ItsArkum 42 — 6y

Answer this question