Deepu Posted February 3, 2014 Share Posted February 3, 2014 Sorry for double posting but this is urgent I mean really urgent ! Please help me again who is experienced at this ... as per TAPL said I used if source == markerB then look this the test script thePlayer = getLocalPlayer () local x,y,z = getElementPosition(thePlayer) local markerA = createMarker(x,y + 3,z, "cylinder", 2, 255, 2, 0) function makae (hitElement) if hitElement == thePlayer then local markerB = createMarker(x,y + 6,z, "cylinder", 2, 255, 2, 0) end end addEventHandler("onClientMarkerHit", markerA, makae) function giga (hitElement) if hitElement == thePlayer then if source == markerB then setElementHealth(thePlayer, 20) end end end addEventHandler("onClientMarkerHit", getRootElement(), giga) please Help ! Please edit the full script and post the full script and thanks in advance Link to comment
Karuzo Posted February 3, 2014 Share Posted February 3, 2014 What doesnt work ? Any errors in debugscript 3 ? Link to comment
Deepu Posted February 3, 2014 Author Share Posted February 3, 2014 Yeah it says expected element at argument 2 got nil at event Handler line 20 which means the server thinks that marker B is not created Link to comment
Karuzo Posted February 3, 2014 Share Posted February 3, 2014 Where is the marker at line 20 ? i mean addEventHandler("onClientMarkerHit", getRootElement(), giga) Where do you define that the player has to hit the markerB. i'm sorry if im wrong. Link to comment
WASSIm. Posted February 3, 2014 Share Posted February 3, 2014 local thePlayer = getLocalPlayer () local x, y, z = getElementPosition(thePlayer) local markerA = createMarker(x, y+3, z, "cylinder", 2, 255, 2, 0, 170) function makae (hitElement) if hitElement == thePlayer then markerB = createMarker(x,y + 6,z, "cylinder", 2, 255, 2, 0, 170) end end addEventHandler("onClientMarkerHit", markerA, makae) function giga (hitElement) if hitElement == thePlayer then setElementHealth(thePlayer, 20) end end addEventHandler("onClientMarkerHit", markerB, giga) Link to comment
Deepu Posted February 3, 2014 Author Share Posted February 3, 2014 Doesnt work wassim It used to work but now I am having errors Link to comment
Karuzo Posted February 3, 2014 Share Posted February 3, 2014 Then tell us those errors pls. Link to comment
Deepu Posted February 3, 2014 Author Share Posted February 3, 2014 it just says expected element at Argument 2 line 20 got nil which means the markerB thing was created on markerA hit. The thing is that at the second function, the marker is not seen by the server thats the problem How to make the server realise that a marker was created on marker hit Link to comment
Deepu Posted February 3, 2014 Author Share Posted February 3, 2014 Worked ! close the topic please I am a mad guy man I had put source == markerB where marker B is in local Link to comment
Deepu Posted February 3, 2014 Author Share Posted February 3, 2014 also thanks friends for making me think and of course for helping me 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