Gtagasje Posted October 15, 2011 Share Posted October 15, 2011 I have made a script ( with help ) of gates, which will open if you are on the team AirForce. But now I wan't it to open for the teams AirForce and Army. Can somebody help me please? this is what I have: (P.S. it's only open gate, not the move back) local ingang1 = createObject ( 980, -1907.9000244141, 2172.8999023438, 3.2000000476837, 0, 0, 0 ) function moveGate1 ( hitElement, matchingDimension ) if getElementType ( hitElement ) == "player" and getPlayerTeam ( hitElement ) ==getTeamFromName( "AirForce") then moveObject ( ingang1, 3000, -1907.9000244141, 2172.8999023438, 9 ) end end addEventHandler("onMarkerHit", ingangmarker, moveGate1) Ps, ingang1 means entrace1 Link to comment
myonlake Posted October 15, 2011 Share Posted October 15, 2011 (edited) You don't have a marker from onMarkerHit event. local ingang1 = createObject(980, -1907.9000244141, 2172.8999023438, 3.2000000476837, 0, 0, 0) local ingangmarker = createMarker(-1907.9000244141, 2172.8999023438, 3.2000000476837, "cylinder", 5, 0, 0, 0, 0) function moveGate1(hitElement, matchingDimension) local airForce = getPlayerTeam(hitElement) == getTeamFromName("AirForce") local army = getPlayerTeam(hitElement) == getTeamFromName("Army") if getElementType(hitElement) == "player" then if airForce or army then moveObject(ingang1, 3000, -1907.9000244141, 2172.8999023438, 9) end end end addEventHandler("onMarkerHit", ingangmarker, moveGate1) Edited October 15, 2011 by Guest Link to comment
Castillo Posted October 15, 2011 Share Posted October 15, 2011 That was not his question, I guess this is a part of his script. local ingang1 = createObject ( 980, -1907.9000244141, 2172.8999023438, 3.2000000476837, 0, 0, 0 ) local teams = {["AirForce"] = true, ["Army"] = true} function moveGate1 ( hitElement, matchingDimension ) if getElementType ( hitElement ) == "player" and getPlayerTeam ( hitElement ) and teams[getTeamName(getPlayerTeam ( hitElement ))] then moveObject ( ingang1, 3000, -1907.9000244141, 2172.8999023438, 9 ) end end addEventHandler("onMarkerHit", ingangmarker, moveGate1) Link to comment
Gtagasje Posted October 15, 2011 Author Share Posted October 15, 2011 I forget the marker to add, cus my script was a bit longer, so I coppied the needed things, and thx castillo 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