Jump to content

Move object - (crazy stuff Please HELP)


Recommended Posts

Hey,

I have this script, and when i enter the colshape it basicly does alot of crazy stuff, i need the barrier to move up when enter and down when leave, but it rotates randomly on colshape enter.

Heres my code

Barrier = createObject ( 968, 1544.69, -1630.8, 13.3, 0, 89, 90 ) 
Col = createColTube(1544.8, -1630.3720703125, 11.8182258605957, 10, 10) 
  
addEventHandler('onColShapeHit', Col, 
     function(hitElement, dim) 
         if getElementType(hitElement) == 'player' then 
           if getTeamName(getPlayerTeam" class="kw2">getPlayerTeam" class="kw2">getPlayerTeam(hitElement))=="Police" then 
            playSoundFrontEnd ( 41 ) 
            moveObject(Barrier, 3000, 1544.69, -1630.8, 13.3, 0, 0, 90) 
           end 
         end 
    end 
) 
  
addEventHandler('onColShapeLeave', Col, 
    function(hitElement, dim) 
         if getElementType(hitElement) == 'player' then 
        if getTeamName(getPlayerTeam" class="kw2">getPlayerTeam(hitElement))=="Police" then 
            moveObject(Barrier, 3000, 1544.69, -1630.8, 13.3, 0, 89, 90) 
        end 
         end 
    end 
) 

Can anyone help me with this and correct my code?

Thanks

Link to comment

Heres the script as it should be without kw2 crap

Barrier = createObject ( 968, 1544.69, -1630.8, 13.3, 0, 89, 90 ) 
Col = createColTube(1544.8, -1630.3720703125, 11.8182258605957, 10, 10) 
  
addEventHandler('onColShapeHit', Col, 
     function(hitElement, dim) 
         if getElementType(hitElement) == 'player' then 
           if getTeamName(getPlayerTeam(hitElement))=="Police" then 
            moveObject(Barrier, 3000, 1544.69, -1630.8, 13.3, 0, 0, -90) 
           end 
         end 
    end 
) 
  
addEventHandler('onColShapeLeave', Col, 
    function(hitElement, dim) 
         if getElementType(hitElement) == 'player' then 
        if getTeamName(getPlayerTeam(hitElement))=="Police" then 
            moveObject(Barrier, 2000, 1544.69, -1630.8, 13.3, 0, 89, 90) 
        end 
         end 
    end 
) 

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