Jump to content

[HELP]Gate Problem


Z-Dash

Recommended Posts

Hello,i just made a script for LSPD Gate/Barrier but when 2 ppl enter the ColShape it moves 2 times and it doesn't stop at the place it must stop at the ending point...it goes under the floor and goes in a 360 motion if there was about 5 ppl trying to get in

and if there is one getting in he must wait for the gate to get fully opened to leave ColShape...

i mean there is not a stopping stopping for opening and closing...

and idk the way to script that it stops at the ending point...

Whole Script..

Video:

        eBarrier = createObject ( 968, 1544.6999511719, -1630.5999755859, 13.10000038147, 0, 90, 90 ) 
        gatecol = createColCircle ( 1544.5999755859, -1627.1999511719, 12.39999961853, 1 
 ) 
        bar1 = createObject ( 994, 1544.6999511719, -1623.9000244141, 12.39999961853, 0, 0, 90 ) 
        bar2 = createObject ( 994, 1544.6999511719, -1623.9000244141, 13.39999961853, 0, 0, 90 ) 
        bar3 = createObject ( 994, 1544.9000244141, -1639.0000000000, 12.39999961853, 0, 0, 90 ) 
        bar4 = createObject ( 994, 1544.9000244141, -1639.0000000000, 13.39999961853, 0, 0, 90 ) 
         
function og(thePlayer) 
if ( getTeamName(getPlayerTeam(thePlayer)) == "Police" ) then 
        moveObject (eBarrier, 1500, 1544.6999511719, -1630.5999755859, 13.10000038147, 0, -90, 0 ) 
end 
end 
  
  
function cg(thePlayer) 
if ( getTeamName(getPlayerTeam(thePlayer)) == "Police" ) then 
        moveObject (eBarrier, 1500, 1544.6999511719, -1630.5999755859, 13.10000038147, 0, 90, 0 ) 
end 
end 
  
  
addEventHandler( "onColShapeHit", gatecol, og ) 
  
  
addEventHandler( "onColShapeLeave", gatecol, cg ) 
  
  

Edited by Guest
Link to comment
eBarrier = createObject ( 968, 1544.6999511719, -1630.5999755859, 13.10000038147, 0, 90, 90 ) 
gatecol = createColCircle ( 1544.5999755859, -1627.1999511719, 12.39999961853, 1 ) 
bar1 = createObject ( 994, 1544.6999511719, -1623.9000244141, 12.39999961853, 0, 0, 90 ) 
bar2 = createObject ( 994, 1544.6999511719, -1623.9000244141, 13.39999961853, 0, 0, 90 ) 
bar3 = createObject ( 994, 1544.9000244141, -1639.0000000000, 12.39999961853, 0, 0, 90 ) 
bar4 = createObject ( 994, 1544.9000244141, -1639.0000000000, 13.39999961853, 0, 0, 90 ) 
moving = false 
  
function move ( thePlayer ) 
    if ( getTeamName ( getPlayerTeam ( thePlayer ) ) == "Police" ) then 
        if ( moving ) then 
            return 
        end 
  
        if ( eventName == "onColShapeHit" ) then 
            moveObject ( eBarrier, 1500, 1544.6999511719, -1630.5999755859, 13.10000038147, 0, -90, 0 ) 
            moving = true 
        else 
            moveObject ( eBarrier, 1500, 1544.6999511719, -1630.5999755859, 13.10000038147, 0, 90, 0 ) 
            moving = true 
        end 
    end 
end 
addEventHandler ( "onColShapeHit", gatecol, move ) 
addEventHandler ( "onColShapeLeave", gatecol, move ) 

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