you wont get help, use 0.3.6 by cykotitanthis script don't work for tfs 0.4 dev when kill monster no loot and when change monsterlootmsg to 0 no loot and no msg and when kill monster all script appear in consol :S anyone know why ?
better start using 0.3.6i don't have 0.3.6 tfs i have 0.4
[25/04/2015 16:15:09] [Error - CreatureScript Interface]
[25/04/2015 16:15:09] In a timer event called from:
[25/04/2015 16:15:09] buffer:onKill
[25/04/2015 16:15:09] Description:
[25/04/2015 16:15:09] [string "loadBuffer"]:53: attempt to compare number with nil
[25/04/2015 16:15:09] stack traceback:
[25/04/2015 16:15:09] [string "loadBuffer"]:53: in function 'createLoot'
[25/04/2015 16:15:10] [string "loadBuffer"]:225: in function <[string "loadBuffer"]:212>
@imkingran when I add that to mods, I login to my OT and I test it (with minotaurs atm) but whatever I kill, itll say "Loot of a XX - " then all the items, but there's NOTHING in the body at all.
Edit : The log itself is a huge ass error lol
Disable your MOD and try to use just the creaturescript as Zbizu does in this post:
https://otland.net/threads/mod-random-item-stats.130295/page-14#post-1956574
Can anyone help me? The rare/legendary items drop, but it doesn't do any effect. How can I make it say "RARE" with a green sparkle under it once every second, for 5 seconds, above the body that dropped it?
Use addEvent() to send delayed messages.
addEvent(callback, delay, ...)
Here is a full list of functions you may find helpful: TFS 0.4 Functions
if( ret )then
doSendMagicEffect(pos, CONST_ME_MAGIC_GREEN)
doSendAnimatedText(pos, ret:upper(), tiers[ret].color)
addEvent(callback, delay, 1000)
end
I addedand I get an error "Callback parameter should be a function"Code:if( ret )then doSendMagicEffect(pos, CONST_ME_MAGIC_GREEN) doSendAnimatedText(pos, ret:upper(), tiers[ret].color) addEvent(callback, delay, 1000) end
addEvent(callback, delay, parameters)
"Callback should be a function" - this means exactly that. In your situation what are the functions that you are trying to add a delay on?
- doSendAnimatedText
- doSendMagicEffect
Those functions should replace the word callback.
Next is delay, you should replace here the time in miliseconds for which you would like to delay the event.
- 1000
This number should replace the word delay.
Last but not least is the parameters. These parameters should match the parameters of the function you are trying to callback. Let's take a look at doSendAnimatedText for example:
doSendAnimatedText(pos, text, color) -- The words in green are the parameters of the function. These are the values that should be added to the end of the addEvent.
addEvent(doSendAnimatedText, 1000, pos, text, color)
addEvent(callback, delay, parameters)
if( ret )then
doSendMagicEffect(pos, CONST_ME_MAGIC_GREEN)
doSendAnimatedText(pos, ret:upper(), tiers[ret].color)
addEvent(doSendAnimatedText, 1000, pos, RARE, color)
end
doAddContainerItemEx(parent, tmp)
size = size + 1
end
end
end
return size > 0
end
local function dropLoot(pos, v, ext, master, cid, target)
local corpse
if( not master or master == target )then -- 0.3/4
corpse = getTileItemById(pos, v.lookCorpse).uid
if( isContainer(corpse) )then
for i = 1, getContainerSize(corpse) do
doRemoveItem(getContainerItem(corpse, 0).uid)
end
local size, cap = 0, getContainerCap(corpse)
for i = 1, #v.loot do
if( size == cap )then
break
end
local tmp, ret = createLoot(v.loot[i], ext)
if( tmp )then
if( isContainer(tmp) )then
if( createChildLoot(tmp, v.loot[i].child, ext, pos) )then
doAddContainerItemEx(corpse, tmp)
size = size + 1
else
doRemoveItem(tmp)
end
else
if( ret )then
doSendMagicEffect(pos, CONST_ME_MAGIC_GREEN)
doSendAnimatedText(pos, ret:upper(), tiers[ret].color)
addEvent(doSendAnimatedText, 1000, pos, RARE, color)
end