hello, i am new scripter trying to make it to where when you kill a zombie, a part in the workspace has can collide on false, so you can walk through that part. so far, nothing i have tried works. there is a lot of problems with my current script but here it is
function onDeath(Humanoid) game.Workspace.WALL.CanCollide = false end script.Parent.Humanoid.Died:Connect(onDeath) onDeath(script.Parent.Humanoid.Health > 0)
EDIT
I have shortened the script a lot now (thank u incapaz) but it still doesn't seem to work..
function onDeath() game.Workspace.mainwall.CanCollide = false end onDeath(script.Parent.Humanoid.Health > 0)
EDIT 2:
still haven't fixed the problem, but now studio won't work for me, giving me a "cant open place" error (has to do with team create i think), but i would still appreciate any suggestions for the script to work, thank u.
I don't see why this wouldn't work:
function onDeath() workspace.mainwall.CanCollide = false end script.Parent.Humanoid.Died:Connect(onDeath)
Are you receiving any errors? If so, please tell us what they are so we can try to fix your problem. Also, did you change the name of the wall? In the two pieces of code you have in your question, you are changing CanCollide to false for 2 different parts.