Skip to content

Current questions and answers regarding the map editor.

User Avatar
#5268
Auto-translated
Hello everyone! How can I add or subtract gold from a player's current amount? For example, a player has 2500 gold, and after completing a quest, they receive 1000, resulting in a total of 3500. I tried doing it like this:

gold=GetPlayerResource(1,GOLD); I declared a variable.

and then I used this command to change the player's gold amount:

SetPlayerResource (1, GOLD, gold-1000);

But the command doesn't work correctly. It does change the player's gold amount, but not as it should. Instead of 3500 gold, the function gives approximately 45000.