Dzsipszi Posted November 5, 2012 Share Posted November 5, 2012 Someone tell me this script works phq1 = createObject ( 968, 1544.699, -1630.798, 13.100, 0, 88.9, 90 ) phq1col = createColCircle ( 1542.699, -1630.798, 13.100, 7 ) function openphq1(thePlayer) if getElementModel( thePlayer ) == 0 then moveObject (phq1, 968, 1544.699, -1630.798, 13.100, 0, 0, 90 ) end end addEventHandler( "onColShapeHit", phq1col, openphq1 ) function closephq1(thePlayer) if getElementModel( thePlayer ) == 0 then moveObject (phq1, 968, 1544.699, -1630.798, 13.100, 0, 88.9, 90 ) end end addEventHandler( "onColShapeLeave", phq1col, closephq1 ) Hmm, i think he is lie check this out: https://www.youtube.com/watch?v=-aWLZ2NyFeA Link to comment
myonlake Posted November 5, 2012 Share Posted November 5, 2012 The script doesn't know if the gate is moving or not. This should work, not tested though. phq1 = createObject(968, 1544.699, -1630.798, 13.100, 0, 88.9, 90) phq1col = createColCircle(1542.699, -1630.798, 13.100, 7) moving = false movetime = 968 addEventHandler("onColShapeHit", phq1col, function(hitElement, matchingDimension) if getElementType(hitElement) == "player" and matchingDimension then if getElementModel(hitElement) == 0 then if moving == false then moveObject(phq1, movetime, 1544.699, -1630.798, 13.100, 0, 0, 90) moving = true setTimer(function() moving = false end, movetime, 1) end end end end ) addEventHandler("onColShapeLeave", phq1col, function(hitElement, matchingDimension) if getElementType(hitElement) == "player" and matchingDimension then if getElementModel(hitElement) == 0 then if moving == false then moveObject (phq1, movetime, 1544.699, -1630.798, 13.100, 0, 88.9, 90) moving = true setTimer(function() moving = false end, movetime, 1) end end end end ) Link to comment
Dzsipszi Posted November 5, 2012 Author Share Posted November 5, 2012 Same problem again... check the video and see my problem Link to comment
TAPL Posted November 5, 2012 Share Posted November 5, 2012 phq1 = createObject ( 968, 1544.699, -1630.798, 13.100, 0, 90, 90 ) phq1col = createColCircle ( 1542.699, -1630.798, 13.100, 7 ) function openphq1(thePlayer) if getElementModel( thePlayer ) == 0 then moveObject(phq1, 968, 1544.699, -1630.798, 13.100, 0, -90) end end addEventHandler( "onColShapeHit", phq1col, openphq1 ) function closephq1(thePlayer) if getElementModel( thePlayer ) == 0 then moveObject(phq1, 968, 1544.699, -1630.798, 13.100, 0, 90) end end addEventHandler( "onColShapeLeave", phq1col, closephq1 ) Link to comment
Dzsipszi Posted November 5, 2012 Author Share Posted November 5, 2012 Amm... looks like its worked but... if i go closer i see 2 gate... 1 is your going up normally and 1 gate is stay in the ( 968, 1544.699, -1630.798, 13.100, 0, 90, 90 ) how can be made it to coded gate? like: /nyit 45612 for unlock & /zár for lock Link to comment
TAPL Posted November 5, 2012 Share Posted November 5, 2012 Dzsipszi said: Amm... looks like its worked but... if i go closer i see 2 gate... 1 is your going up normally and 1 gate is stay in the ( 968, 1544.699, -1630.798, 13.100, 0, 90, 90 ) how can be made it to coded gate? like: /nyit 45612 for unlock & /zár for lock i guess you have the other gate from map file/map editor. About the command, you can use addCommandHandler and make sure the script knew if the gate is moving or not, as myonlake told you. Link to comment
Dzsipszi Posted November 6, 2012 Author Share Posted November 6, 2012 Thank you guys for help to me! The gate is working 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