• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

New drinkable item!

zxzxzx

New Member
Joined
Mar 12, 2011
Messages
334
Reaction score
3
Hello! I want to make item id: 18305 drinkable and then change it to item id 3942.

how to make it? tfs 1.2

help rep++
 
Code:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
item:transform(3942)
return true
end
dont forget to register it in actions.xml
 
Code:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
item:transform(3942)
return true
end

This is my script, I only want to add drink sound like other potions.
 
local exhaust = Condition(CONDITION_EXHAUST_HEAL)

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
item:transform(3942)
player:addCondition(exhaust)
target:say("Aaaah...", TALKTYPE_MONSTER_SAY)
return true
end
 
local exhaust = Condition(CONDITION_EXHAUST_HEAL)

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
item:transform(3942)
player:addCondition(exhaust)
target:say("Aaaah...", TALKTYPE_MONSTER_SAY)
return true
end
I have error - attempt to call method "say" a ni value - using tfs 1.2
 
are you using it on a player, or inside inventory on itself?
Code:
local t = isPlayer(target) and target or player
t:say("Aaaah...", TALKTYPE_MONSTER_SAY)
that should work
 
Ok! now work! thanks ;) full code -

Code:
local exhaust = Condition(CONDITION_EXHAUST_HEAL)

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
item:transform(3942)
local t = isPlayer(target) and target or player
t:say("Aaaah...", TALKTYPE_MONSTER_SAY)
return true
end
 
Back
Top