JasperRieken Posted December 17, 2010 Share Posted December 17, 2010 I made a script need it to open on marker hit but can't get it to work This is the script local Poortzombie = createObject (10841,1202.5509033203,-1389.4356689453,20.241466522217,0,0,179.99450683594) local marker = createMarker(1201.7279052734,-1389.3259277344,13.16607093811, "Cylinder",20, 255, 0, 0, 0) function openZombieGate(hitplayer) moveObject (Poortzombie,1000,1202.5509033203,-1389.4356689453,6.4914665222168) end addEventHandler("onMarkerHit",marker,openZombieGate) function closeZombieGate(hitplayer) moveObject (Poortzombie,1000,1202.5509033203,-1389.4356689453,20.241466522217) end addEventHandler("onMarkerLeave",marker,closeZombieGate) If someone can help me that would be nice Link to comment
Aibo Posted December 17, 2010 Share Posted December 17, 2010 is it client or server script? if it's client-side — it won't work because of events. if server — idk, tell us what happens (like marker is there but nothing happens) and what doesnt (like even no marker created). Link to comment
JasperRieken Posted December 17, 2010 Author Share Posted December 17, 2010 Yes everything is there it's serversided but it just wont do anyting Link to comment
JasperRieken Posted December 17, 2010 Author Share Posted December 17, 2010 Ow wait it doesn't create the marker so what can i do? Link to comment
Aibo Posted December 17, 2010 Share Posted December 17, 2010 have you added it correctly to meta.xml? does it even starts? if it does — add some debug output to event handlers to see if event is triggered at all like: local Poortzombie = createObject (10841,1202.5509033203,-1389.4356689453,20.241466522217,0,0,179.99450683594) local marker = createMarker(1201.7279052734,-1389.3259277344,13.16607093811, "cylinder",20, 255, 0, 0, 0) function openZombieGate(hitplayer) outputChatBox("gate opens") moveObject (Poortzombie,1000,1202.5509033203,-1389.4356689453,6.4914665222168) end addEventHandler("onMarkerHit",marker,openZombieGate) function closeZombieGate(hitplayer) outputChatBox("gate closes") moveObject (Poortzombie,1000,1202.5509033203,-1389.4356689453,20.241466522217) end addEventHandler("onMarkerLeave",marker,closeZombieGate) try to replace "Cylinder" with "cylinder" (honestly, i dont know if it's case-sensitive, just to be safe) but first change your marker alpha (last 0) to something else than 0 (you wont see a marker with zero alpha) local marker = createMarker(1201.7279052734,-1389.3259277344,13.16607093811, "cylinder", 20, 255, 0, 0, 128) Link to comment
JasperRieken Posted December 17, 2010 Author Share Posted December 17, 2010 Yes i know about the alpha let me try you will hear more in a min and it does start becuease the creategate thing works Link to comment
JasperRieken Posted December 17, 2010 Author Share Posted December 17, 2010 Omg You where right the cylinder thing whas good it works now ThankYou So Mutch Link to comment
Aibo Posted December 17, 2010 Share Posted December 17, 2010 next time use "/debugscript 3" command to see if your script gives any errors, if it has marker type name error, it'll obviously be there Link to comment
JasperRieken Posted December 17, 2010 Author Share Posted December 17, 2010 Where can i find /debug thing? Link to comment
Oz. Posted December 17, 2010 Share Posted December 17, 2010 Just type: /debugscript 3 ...into chat, or simply: debugscript 3 ...into console (F8 or ~) 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