Xwad Posted September 21, 2015 Posted September 21, 2015 Hi i want to make that if a player leaves the marker then the timer stops. I made it but its not working:( This is a part of the script. --on marker hit function createMarker(hitElement, matchingDimension) if getElementType(hitElement) =="player" and getPlayerTeam(hitElement) and getTeamName (getPlayerTeam(hitElement)) == "German" then outputChatBox("Please,Stay 10 Secs in the marker to capture the area!",thePlayer,255,109 ,109 ) local timer = setTimer ( captureAreaG, 4000, 1 ) else outputChatBox("Please,Stay 10 Secs in the marker to capture the area!",thePlayer,255,109 ,109 ) local timer = setTimer ( captureAreaA, 4000, 1 ) end end addEventHandler("onMarkerHit", marker, createMarker) --on marker leave function markerLeave( leaveElement, matchingDimension, theTimer, thePlayer ) outputChatBox("You have failed to capture the area!",getRootElement(), 255, 50, 50) if isTimer ( timer ) then killTimer ( timer ) end addEventHandler( "onMarkerLeave", marker, markerLeave )
t3wz Posted September 21, 2015 Posted September 21, 2015 make the timer's variable global. timer = setTimer ........
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