DRW Posted May 9, 2015 Posted May 9, 2015 I tried to remove negative money by doing this: local money = getPlayerMoney (source) addEventHandler ("onClientResourceStart", getResourceRootElement(getThisResource()), function () setTimer (function () if (money < 0) then setPlayerMoney (source, 0) end end end), 10000,0) Not working, says that is a ) expected to close function in line 4 ( I try to make it another way but it's not working, edited a lot of times and still giving me errors... What can I do? Proud owner and developer of ZNEXT: Aftermath. Enter a post-apocalyptic San Andreas and fight over 30 types of enemies and bosses with varying difficulties and skills, improve and customize your character by leveling up, completing challenges and a solid lootbox system with no Pay-to-Win mechanics that will break your experience. Meet new characters, creatures and weapon metas, experience an innovative combo-based melee system, or join our solid PvP modes to show other survivors who’s boss. Español, Pусский, Türk, عربى, Polski, Português IP: mtasa://104.36.110.227:22003 - Discord: https://discord.gg/CxMxjvC5pB
xTravax Posted May 9, 2015 Posted May 9, 2015 wtf you talking unpredictable?plz stop addEventHandler ("onClientResourceStart", getResourceRootElement(getThisResource()), function () setTimer (function () local money = getPlayerMoney (localPlayer) if (money < 0) then setPlayerMoney (localPlayer, 0) end end, 10000,0) end)
DRW Posted May 9, 2015 Author Posted May 9, 2015 wtf you talking unpredictable?plz stop addEventHandler ("onClientResourceStart", getResourceRootElement(getThisResource()), function () setTimer (function () local money = getPlayerMoney (localPlayer) if (money < 0) then setPlayerMoney (localPlayer, 0) end end, 10000,0) end) God dammit, I'm an idiot, I combined serverside and clientside things, lol. Thank you so much Proud owner and developer of ZNEXT: Aftermath. Enter a post-apocalyptic San Andreas and fight over 30 types of enemies and bosses with varying difficulties and skills, improve and customize your character by leveling up, completing challenges and a solid lootbox system with no Pay-to-Win mechanics that will break your experience. Meet new characters, creatures and weapon metas, experience an innovative combo-based melee system, or join our solid PvP modes to show other survivors who’s boss. Español, Pусский, Türk, عربى, Polski, Português IP: mtasa://104.36.110.227:22003 - Discord: https://discord.gg/CxMxjvC5pB
WhoAmI Posted May 9, 2015 Posted May 9, 2015 It won't work. addEventHandler ("onClientResourceStart", resourceRoot, function () setTimer (function () local money = getPlayerMoney () if (money < 0) then setPlayerMoney (0) end end, 10000,0) end) I prefer you to do this s-side like that addEventHandler ("onResourceStart", resourceRoot, function () setTimer (function () for _, player in pairs ( getElementsByType ( "player" ) ) do local money = getPlayerMoney (player) if (money < 0) then setPlayerMoney (player, 0) end end end, 10000,0) end)
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