will briggs Posted June 11, 2011 Share Posted June 11, 2011 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
UAEpro Posted June 11, 2011 Share Posted June 11, 2011 add after getPlayerTeam any random number to see the code Link to comment
Callum Posted June 11, 2011 Share Posted June 11, 2011 Why do you randomly have 'class="kw2">' all over your script? Link to comment
will briggs Posted June 11, 2011 Author Share Posted June 11, 2011 Im not sure, jack my scripter added so that it only opens for the team police... Link to comment
Callum Posted June 11, 2011 Share Posted June 11, 2011 Are you sure he can script? It seems he pastes XML nodes hoping lua can read his mind and make a script. Link to comment
will briggs Posted June 11, 2011 Author Share Posted June 11, 2011 Im pretty sure he can script... go to 78.109.189.219:22003 if you dont belive me, all i need is help and im turning here to my last resort cus im shit at computers. Link to comment
UAEpro Posted June 11, 2011 Share Posted June 11, 2011 Why do you randomly have 'class="kw2">' all over your script? because [lua] is not showing getPlayerTeam ... and add after it 'class="kw2">' so re edit your code and rename each getPlayerTeam to getPlayerTeam_1 Link to comment
Resmurf Posted June 11, 2011 Share Posted June 11, 2011 i would recommend u use doors by acl since if people not on a team (when they login) the gate will open saying unknown or u got to add the gate to not open to unknown teams. Link to comment
will briggs Posted June 11, 2011 Author Share Posted June 11, 2011 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
will briggs Posted June 11, 2011 Author Share Posted June 11, 2011 Bump - Please help me... Link to comment
Aibo Posted June 12, 2011 Share Posted June 12, 2011 i replied in your other topic, you didnt even bother to undestand. now you want it to move UP, but setting rotation with moveObject. seriously, why? Link to comment
will briggs Posted June 12, 2011 Author Share Posted June 12, 2011 Ive done it... And i now understand it... Thanks for your help. 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