Z-Dash Posted July 13, 2013 Share Posted July 13, 2013 (edited) 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 July 13, 2013 by Guest Link to comment
Castillo Posted July 13, 2013 Share Posted July 13, 2013 Make a variable defining if the gate is moving or not. Link to comment
Z-Dash Posted July 13, 2013 Author Share Posted July 13, 2013 Make a variable defining if the gate is moving or not. How can i do that? Sorry i'm a new scripter Please Help! Link to comment
Castillo Posted July 13, 2013 Share Posted July 13, 2013 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
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