Snoozy Posted January 15, 2011 Share Posted January 15, 2011 I'm trying to send a TEST message when player1 touches player2 function outputElementType( prev, current ) if(current) then if getElementType(current) == "player" then outputChatBox("TEST") end end end addEventHandler ("onPlayerContact", getRootElement(),outputElementType) Link to comment
Scooby Posted January 16, 2011 Share Posted January 16, 2011 add some debug to see if the function outputElementType is actually triggering. i havent tried using "onPlayerContact" before, however the wiki says: This event is triggered when a player stands on a different element than before. and the parameters say: * previousElement: The element player was standing on before. nil if none. * currentElement: The new element that the player is standing on now. nil if none. Link to comment
Snoozy Posted January 16, 2011 Author Share Posted January 16, 2011 Hmm wait a sec, I must have not read it enough I mean it says: stand on, does that mean it only triggers if I stand on top of the player? Link to comment
Buffalo Posted January 16, 2011 Share Posted January 16, 2011 Exactly. It made me confused too earlier. Link to comment
Snoozy Posted January 16, 2011 Author Share Posted January 16, 2011 Oh okay that explains it tbh, thanks you anyway guys. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now