TheScriptingNewbie Posted February 20, 2013 Posted February 20, 2013 Hello, i have this script: local marker = createMarker( 206.8258972168, -1656.9514160156, 13.52540397644, "checkpoint") addEventHandler("onMarkerHit", marker, function(hitElement) if (getElementType(hitElement) == "player") then givePlayerMoney(hitElement, 5000) setTimer ( givePlayerMoney , 1000, 1) end end ) I try to make a timer, so that i get money every second, i don't know how to do it and did alot of nonsense, any help?
Castillo Posted February 20, 2013 Posted February 20, 2013 You want to give money to every player inside the marker?
TheScriptingNewbie Posted February 20, 2013 Author Posted February 20, 2013 Yes, i want that they would get 5000$ every 1 second. Without heading out of the marker, but i have no idea of how to do it.
K4stic Posted February 20, 2013 Posted February 20, 2013 function givemoney(hitElement) if (getElementType(hitElement) == "player") then givePlayerMoney(hitElement, 5000) end end addEventHandler("onMarkerHit", marker, givemoney ) setTimer ( givemoney , 1000, 1)
Castillo Posted February 20, 2013 Posted February 20, 2013 local marker = createMarker ( 206.8258972168, -1656.9514160156, 13.52540397644, "checkpoint" ) setTimer ( function ( ) for _, player in ipairs ( getElementsWithinColShape ( getElementColShape ( marker ), "player" ) ) do givePlayerMoney ( player, 5000 ) end end ,1000, 0 )
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