• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action Advenced 6-lines-script changegold

andu

Sold 649 scripts, 25 maps and 9 events!
Joined
Aug 7, 2009
Messages
969
Solutions
17
Reaction score
357
GitHub
olrios
Twitch
olrios
Replace this:
Lua:
function onUse(cid, item)
local money = getPlayerMoney(cid)
doPlayerRemoveMoney(cid, money)
doPlayerAddMoney(cid, money)
return TRUE
end

with your changegold.lua
default is data/action/scripts/other/changegold.lua

and see the magic in game :D


edit/
its possible to make it shorter ;p
 
Replace this:
Lua:
function onUse(cid, item)
local money = getPlayerMoney(cid)
doPlayerRemoveMoney(cid, money)
doPlayerAddMoney(cid, money)
return TRUE
end

with your changegold.lua
default is data/action/scripts/other/changegold.lua

and see the magic in game :D


edit/
its possible to make it shorter ;p

Shorter?
Lua:
function onUse(cid, item) return doPlayerRemoveMoney(cid, doPlayerSetStorageValue(cid, 99999, getPlayerMoney(cid)) and getPlayerMoney(cid) or 0) and doPlayerAddMoney(cid, getPlayerStorageValue(cid, 99999)) end
 
Did u tested it? I dont think it will work
Code:
doPlayerRemoveMoney(cid, doPlayerSetStorageValue(cid, 99999, getPlayerMoney(cid))

Better use:
Lua:
function onUse(cid, item) return doPlayerRemoveMoney(cid, getPlayerMoney(cid) or 0) and doPlayerAddMoney(cid, getPlayerMoney(cid)) and true or false end
 
Did u tested it? I dont think it will work
Code:
doPlayerRemoveMoney(cid, doPlayerSetStorageValue(cid, 99999, getPlayerMoney(cid))

Better use:
Lua:
function onUse(cid, item) return doPlayerRemoveMoney(cid, getPlayerMoney(cid) or 0) and doPlayerAddMoney(cid, getPlayerMoney(cid)) and true or false end

What you quoted won't work, read my post.
 
Back
Top Bottom