GhostX
Mapping Board Moderator
Basically the idea is, I'll have a donations room on my server, where the player can go in, click use on an item and it appears in backpack, that player can then use that item for 1 hit and then it disapears!
For example: Item is on a table; AID 1001, player right clicks + use on said item and it appears in bp or in hand (if empty) with action/unique id 1002 (if needed to make it disappear)
They then can use it to attack once, to test it. Item then disappears!
Now the script i need requires the following:
I will be extremely greatful for any attempt at a script whether it be successful or not, and will rep the attempted help if not (but no "ayayaya i get free rep by posting obvious bad code" please)
In the meantime i will attempt this, and post results as an edit.
MY ATTEMPT
I don't know how to do teleport thing or anything ahaha first script attempt ever :/
For example: Item is on a table; AID 1001, player right clicks + use on said item and it appears in bp or in hand (if empty) with action/unique id 1002 (if needed to make it disappear)
They then can use it to attack once, to test it. Item then disappears!
Now the script i need requires the following:
XML:
Item disappears if player uses a teleport with (for example unique/action id 1000)
Can only get item if there no same item with that UID/AID are in bp or on the person (yet can get again once it is gone)
Player must be level 20+
I will be extremely greatful for any attempt at a script whether it be successful or not, and will rep the attempted help if not (but no "ayayaya i get free rep by posting obvious bad code" please)
In the meantime i will attempt this, and post results as an edit.
MY ATTEMPT
XML:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.aid == 1001 and getPlayerLevel(cid) >= 20 then
doPlayerSendTextMessage(cid,21,"Here is your test donation!")
doPlayerAddItem(uid, itemid[8925, count/subtype[1, canDropOnMap = false]])
elseif getPlayerLevel(cid) <= 20 then
doPlayerSendTextMessage(cid,21,"You are not experienced enough!")
else
doPlayerSendCancel(cid,"You don't have the required level to use this.")
end
return true
end
Last edited: