Hello everyone,I have problem with ontouch script. It should make supply chest disapear, but don't work ;s
Here is script:
local DebounceTime = 0.5
local Debounce = false
local Sup = script.Parent.Parent:WaitForChild("Supply")
local OnTouch = function(Part)
if game.Players:GetPlayerFromCharacter(Part.Parent) and not Debounce then
Debounce = true
for _, child in pairs(Sup:GetChildren()) do
if child:IsA("BasePart") or child:IsA("UnionOperation") then
child.Transparency = 1
child.CanCollide = false
end
end
wait(DebounceTime)
Debounce = false
end
end
script.Parent.Sup.Touched:connect(OnTouch)
I didn't saw any error output.

10 comments
Still don't work.
You script seems like it should work fine but maybe the cause of the problem is the Parenting. Can you take a picture of the Hierarchy?
If you mean explorer screenshoot... https://gyazo.com/195d9bf937fef7bf5c3d2b3989ba38c2
@DevKarolus1 Can you give us a better picture of your Hierarchy with the location of the script?
Ok i think this one will be good.. https://gyazo.com/08a4fc2b191389377d088c05178914bb
Do you want the script to activate when the Player touches the Part called Supply?!?
Yes.
Does it work now?
Thanks work perfectly ;)
No problem. As I suspected your parenting was a bit off etc.