So i am writing a function that will destroy certain objects when the collide with this sensor. Im positive there is an easier way and i have overcomplicated it. But the point is, it doesnt work!
NOTE:
the sensor has the key = “key”
the other three objects have been assigned yes, yay, and die. I made these because if i gave them all the same one then it wouldn’t know what was actually colliding.
Oh, and why wont my removeSelf() work?
[blockcode]
local function winHere(w)
if(w.object1.key == “key”) and (w.object2.myName == “box”) then
w.object2:removeSelf();
if(w.object1.key == “key”) and (w.object2.myName == “triangle”) then
print(“2”)
w.object2:removeSelf();
if(w.object1.key == “key”) and (w.object2.myName == “circle”) then
print(“3”)
w.object2:removeSelf();
if(w.object1.myName == “box”) and (w.object2.key == “key”) then
print(“4”)
w.object1:removeSelf();
if (w.object1.myName == “triangle”)and (w.object2.key == “key”) then
print(“5”)
w.object1:removeSelf();
if (w.object1.myName == “circle”) and (w.object2.key == “key”) then
print(“6”)
w.object1:removeSelf();
end
end
end
end
end
end
end
[/blockcode] [import]uid: 59735 topic_id: 16791 reply_id: 316791[/import]