• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

Basic Gold to Gold Bars

FoxGaming

Exalted Member
This script is very basic, it checks on login how close you are to the gold cap, if you're over 200k gold the script will convert the players gold in to 4x50k gold bars.

This is not very unique, however it sure does beat doing a core mod and recompiling.

Code:
--Gold to Gold Bars--
--Written by FoxGaming--
--www.emudevs.com--

local GoldBar = 70000

local function Check_Money_Login(event, player)
    local gold = player:GetCoinage()
		if (gold > 2000000000) then
				player:SetCoinage(gold-2000000000)
				player:AddItem(GoldBar, 4)
				player:SendNotification("You were nearing the gold cap, we turned your gold into gold bars.")
		end
	end

                     
RegisterPlayerEvent(3, Check_Money_Login)

SQL for GoldBar
 
Last edited:

Barebones

BETA Tester
Nice.

But, instead of forcing a player to have gold bars, you can make an item worth X amount of gold and if the player wants a gold bar or whatever, he/she can go get it.

But that's just me. :p
 

Barebones

BETA Tester
No, it doesn't. The script forces the player to take gold bars on login. If you make gold bar and put it in a vendor (Lets say just one gold bar. You can buy it for 50k and sell it for 50k), a player can go to the vendor at any time and buy it if they want to.
 

FoxGaming

Exalted Member
Thank you,
I had originally used on Money Change, But when i subtracted the 200k gold from the player amount it would give them 4 bars anywhere from 2-10times so you could end up with 8-20bars. Changing it to on login solved the issue. Though the only thing I changed was the function and none of the code lol
 

Foereaper

Founder
No, it doesn't. The script forces the player to take gold bars on login. If you make gold bar and put it in a vendor (Lets say just one gold bar. You can buy it for 50k and sell it for 50k), a player can go to the vendor at any time and buy it if they want to.

So instead of making it automatic, you'd rather risk the player fuck up, go over the cap and have their money reset, thus losing all their gold? Automation makes things seem way more professional than dealing with vendors and manual interaction, especially when you can end up losing things from it :p
 

Barebones

BETA Tester
Gold resets if you go over the cap with the command. If you hit the cap the real way, it doesn't reset or go above.
 

Rochet2

Moderator / Eluna Dev
You cant receive more money when you go to the max : |
Anyways, could be an option to make it like barebones said.
 

Xaver

Respected Member
fix for cata TC


Code:
--Gold to Gold Bars--
--Written by FoxGaming--
--www.emudevs.com--

local GoldBar = 7000200

local function Check_Money_Login(event, player)
    local gold = player:GetCoinage()
				player:SetCoinage(gold-50000000)
				player:AddItem(GoldBar, 1)
				player:SendNotification("You were nearing the gold cap, we turned your gold into gold bars.")
		end


                     
RegisterPlayerEvent(3, Check_Money_Login)
 

Syphex

Exalted Member
Just add a companion that you can spawn and despawns after 1 minute or something, That sells the Gold Bars, Easier for people to use and it won't have the same preasure on the players.
 
Top