Boris. Posted July 8, 2018 Share Posted July 8, 2018 Hello. Im creating money and score system for finish race with onPlayerFinish. How I can got number of checkpoints in this race? I need it for calculate money and points. Code is example addEvent("onPlayerFinish",true) addEventHandler("onPlayerFinish", getRootElement(), function ( rank, time ) local account = getPlayerAccount(source) 50000 if rank == 1 then if not (isGuestAccount(account)) then blabaldaslvadgfad else hgdsfgdsfgds end else end end) Link to comment
Galactix Posted July 12, 2018 Share Posted July 12, 2018 addEvent("onPlayerFinish",true) addEventHandler("onPlayerFinish", getRootElement(), function ( rank, time ) local totalMarker = getMarkerCount() local account = getPlayerAccount(source) if rank == 1 then if not (isGuestAccount(account)) then givePlayerMoney ( source, 2500*totalMarker ) -- change 2500 to the amount you wanna give per checkpoint in race* outputChatBox("You finished the race in first place with "..totalMarker.." markers!", source, 0,255,0) else outputChatBox("You are not registered!", source,255,0,0) return end else end end) Sorry for the late reply! Better get a reply now than never afterall 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