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

Part wont change boolvalue on touch, still notices it touched a part?

Asked by 3 years ago
Edited 3 years ago

So I'm trying to make an axe that will enable a value (to break said part) but when the tool touches a part with a child named "Broken" inside of it, it won't enable that value. The script knows it hit a part with the child "Broken" inside of it but it just won't enable the boolvalue. Please help!

script.Parent.Handle.axeblunt.Touched:Connect(function(hit)
    if hit:FindFirstChild('Broken') then -- checking if the hit part has the value
hit.Broken.Value = true
        print("Touched")
    end
end)

1 answer

Log in to vote
0
Answered by
ElBamino 153
3 years ago

I don't exactly know what you're trying to do but, this MIGHT help you! If it doesn't at least I tried and, you can always ask me in the comments for help.

I don't exactly know what you want from this or what you want to look so everything below is just my assumption.

Basically if you're looking for the value inside of a (handle? I think) this will get the job done. I tested it, you'll probably have to do some editing yourself to get exactly what you want accomplished but, I assure you that this DOES change the value to true on touch if the "hit" has a BoolValue instead of it called "Broken".

function whatever(hit)
    if hit.Broken.Value == false  then
        print("or whatever")
        hit.Broken.Value = true
    end
end
script.Parent.Touched:Connect(whatever)
0
Thanks! It was really simple i just has to make it a script instead of a local script lol. Neutron05 7 — 3y
Ad

Answer this question