Jump to content

setElementposition , getelement in colshape


scaryface87

Recommended Posts

Hello

the element's(player's) position isnt reseting / going somewhere

  
  
cs1 = createColRectangle(377.94525,2432.49194, 53.5, 45 ) 
  
  
function owndebug() 
outputChatBox("YOU ENTERED A COLSHAPE") 
end 
addEventHandler("onColShapeHit",cs1,owndebug) 
  
 function goAway( player ) 
 for i, p in ipairs(getElementsByType("player")) do 
     outputChatBox("does this even work?") -- not working 
            local lol = isElementWithinColShape (p, cs1 ) 
            local x, y, z = getElementPosition(p); 
  
                local x = math.random(371, 373) 
                local y = math.random(160, 165) 
                setElementPosition(p, x, y, 1008.4) 
                                outputChatBox("You're position has being changed!") 
            end 
        end 
  

Greetings ,

scaryface87

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...