freddzor11
Member
- Joined
- May 25, 2009
- Messages
- 695
- Reaction score
- 5
Hello people! I have been looking for a script that can change 100 Gold nuggets till X Premium points, Lever or NPC doesn't matter, just found others script that is just one item, but now I want it to change 100 gold nuggets both is for 0.3.6
Donate changer
Also looking for a teleport scroll that is counting down X numbers, and having exhaust to use and can't use under attack.
Here is my script
Kind regards.
Donate changer
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition) -- Eazy M
local donation_ids = {2157, 2160} --donation ids
local position = getThingfromPos({x=998, y=992, z=8, stackpos=1}) -- position to put the items on
function changeIntoPoints()
if (isInArray(donation_ids, position.itemid)) then
if doRemoveItem(position.uid,1) then
local points = 4 -- how much points to receive
db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points` + " .. points .. " WHERE `id` = " .. getPlayerAccountId(cid))
doPlayerSendCancel(cid, "You received " .. points .. " point(s).")
else
doPlayerSendCancel(cid, "Could not remove the item.")
end
else
doPlayerSendCancel(cid, "Donation item not found.")
end
end
if item.itemid == 9825 then
changeIntoPoints()
doTransformItem(item.uid, item.itemid + 1)
end
if item.itemid == 9826 then
changeIntoPoints()
doTransformItem(item.uid, item.itemid - 1)
end
if item.count == 100 then
--add points
end
return true
end
Also looking for a teleport scroll that is counting down X numbers, and having exhaust to use and can't use under attack.
Here is my script
Code:
function onUse(cid, item, frompos, item2, topos)
ppos = getPlayerPosition(cid)
temple = getPlayerMasterPos(cid)
if (getCreatureCondition(cid, CONDITION_INFIGHT) == FALSE) then
doTeleportThing(cid, temple, TRUE)
doSendMagicEffect(ppos,66)
doSendAnimatedText(frompos,'Wiee!',16)
else
doPlayerSendCancel(cid,"You can't teleport immediately after fight.")
doSendMagicEffect(ppos,2)
end
return 1
end
Kind regards.
Last edited: