SjoerdPSV Posted January 9, 2014 Share Posted January 9, 2014 Hello, I want to make a gate for a specific group, I'm using this group-system: https://community.multitheftauto.com/index.php?p=resources&s=details&id=8036 So I created this script, I don't have any errors in /debugscript but there still happens nothing. gate1 = createObject ( 2990, 1621.39941, -1862, 16.5, 0,0,0 ) gatecol = createColCircle ( 1621.1999511719,-1860.5,12.5, 10 ) function opengates(thePlayer) if ( exports["groups-system"]:getAccountGang ( getPlayerAccount ( thePlayer ) ) == "ArmedForces" ) then moveObject (gate1, 650, 1621.40002, -1862, 7.3 ) end end addEventHandler( "onColShapeHit", gatecol, opengates ) function closegates(thePlayer) if ( exports["groups-system"]:getAccountGang ( getPlayerAccount ( thePlayer ) ) == "ArmedForces" ) then moveObject (gate1, 650, 1621.39941, -1862, 16.5 ) end end addEventHandler( "onColShapeLeave", gatecol, closegates ) Anyone knows what's wrong? Link to comment
The Killer Posted January 9, 2014 Share Posted January 9, 2014 try this gate1 = createObject ( 2990, 1621.39941, -1862, 16.5, 0,0,0 ) gatecol = createColCircle ( 1621.1999511719,-1860.5,12.5, 10 ) local groupName = "Group Name" function opengates(thePlayer) if getElementData(thePlayer, "gang") == groupName then moveObject (gate1, 650, 1621.40002, -1862, 7.3 ) end end addEventHandler( "onColShapeHit", gatecol, opengates ) function closegates(thePlayer) if getElementData(thePlayer, "gang") == groupName then moveObject (gate1, 650, 1621.39941, -1862, 16.5 ) end end addEventHandler( "onColShapeLeave", gatecol, closegates ) change "Group Name" to your group name 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