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.

6 comments
The Died event has no parameters. Anything passed to it will be nil.
thank you, should i replace the "died" part with something else to tell the script the humanoid is dead? or remove that part completally?
Remove the Humanoid parameter on line 1. It's pointless.
i have shortened it to 4 lines now, but it still doesn't seem to work, i edited the new script in my post
you do realize, that means it will make the parts collison off for all players
i was hoping it would do that, im trying to make the collision off forever, since this is for a single player game