Jump to content

onPlayerContact


Snoozy

Recommended Posts

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...