Collision with spawning object

hi guys,

so i’m trying for tutorial purpose (working on another game with similar issue), to add collision with a spawning object.

so this code is from mark falkland flappy bird tutorial, and i’m trying to add an object (a crate) between each column that will change it’s image to a smashed crate once there is a collision between the bird and the crate, collision with the pipe=game over.

i’ve tried making a movie clip, sprite sheet and even hide the smashed image behind the original one and just remove it when the collision is happening, but for some reason i just can’t get any action to work when there is the player/crate collision (but still can see the prints in the output).

this what i managed to do so far but i get an error message-

attempt to index local ‘event’ ( a nil value) 

[lua]
function playerCollision(self, event)
if ( event.phase == “began” ) then
if event.target.type == “player” and event.other.type == “crate” then
print(“crate”)
else
storyboard.gotoScene( “restart” )
print(“bottomColumn”)
end
end
end

[/lua]

also attached is the full code from mark’s video.

Thanks for your help:)