I want to make a script that when a player touches it (the player's name is in variable _G.PlayerStorage and it's only 1 player max) the parent ( a wall ) collision gets removed.
should be easy but I don't know what is wrong with my script:
function onTouch(hit)
if hit.Parent == _G.PlayerStorage then
script.Parent.CanCollide = false
wait(1)
script.Parent.CanCollide = true
end
end
script.Parent.Touched:connect(onTouch) |