• 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!

Spell that creates an item with action id

tnecniiv

scripter to be
Joined
Jan 6, 2012
Messages
294
Solutions
3
Reaction score
23
Code:
function onCastSpell(cid, var)
    doPlayerAddItem(cid, 2579, 1, 1,1)
    doSetItemActionId(2579, 1000)
end
i need script that creates an item with an action ID
i create the item but it doesnt come with an action ID
im trying to create an item that has different spells which will be used for purposes
TFS 1.2
 
Last edited:
Solution
Code:
function onCastSpell(creature, variant)
    local player = creature:getPlayer()
 
    local item = player:addItem(ITEMID)
    item:setActionId(ACTIONID)
end
I guess you can keep that code, but put the doPlayerAddItem function into a variable and then pass that variable as the first parameter in the doSetItemActionId.
 
If you are using tfs 1.2 make sure you are using the latest functions.

here is an example talkaction that will do what you want =) I hope it helps.

Code:
function onSay(player, words, param)
    local item = player:addItem(ITEMID)
    item:setActionId(ACTIONID)
end
 
sorry for late reply but i cannot use talkactions i need to be a spell for the player. if it isnt possible then i would understand
 
Code:
function onCastSpell(creature, variant)
    local player = creature:getPlayer()
 
    local item = player:addItem(ITEMID)
    item:setActionId(ACTIONID)
end
 
Solution
Back
Top