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

Solved Addon script not working tfs 0.3.6

Finduz

New Member
Joined
Nov 13, 2014
Messages
40
Reaction score
0
I'm using this script for getting certain addons from chests.
I think it is Cykotitan who posted it in some thread, but I can't remember which one.
Code:
local t = {
[12001] = 'Citizen',
[12002] = 'Hunter',
[12003] = 'Mage',
[12004] = 'Knight',
[12005] = 'Nobleman',
[12006] = 'Summoner',
[12007] = 'Warrior',
[12008] = 'Barbarian',
[12009] = 'Druid',
[12010] = 'Wizard',
[12011] = 'Oriental',
[12012] = 'Pirate',
[12013] = 'Assassin',
[12014] = 'Beggar',
[12015] = 'Shaman',
[12016] = 'Norse',
[12017] = 'Nightmare',
[12018] = 'Jester',
[12019] = 'Brotherhood',
[12020] = 'Demonhunter',
[12021] = 'Yalaharian',
[12022] = 'Warmaster'
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
if not canPlayerWearOutfitId(cid, item.uid - 12000, 3) then
doCreatureSay(cid, 'You now have the ' ..t[item.uid] .. ' Addons!', TALKTYPE_ORANGE_1)
doPlayerAddOutfitId(cid, item.uid - 12000, 3)
doSendMagicEffect(getThingPos(cid), math.random(67))
else
doCreatureSay(cid, 'You already have the ' .. t[item.uid] .. ' Addons!', TALKTYPE_ORANGE_1, false, cid)
end
return true
end
However it's not working.
Nothing happens when I click the chest.

Actions.xml
Code:
<action uniqueid="12001-12020" event="script" value="outfits.lua"/>
There are no errors in console upon server start nor when I try to use the chest.
 
What item are you using? Try to login on a Gamemaster and view that item to see it's unique id, it should be between 12001 and 12020.

Ignazio
 
What item are you using? Try to login on a Gamemaster and view that item to see it's unique id, it should be between 12001 and 12020.

Ignazio
I'm using a chest, like in any other quest. The uid is correct, I've checked twice. I think it's something in the script, but I'm a noob :)
 
What do you see in your console if you add this under function onUse(cid, item, fromPosition, itemEx, toPosition)?
Code:
print(item.uid)
 
The script might send out errors, but only when it's loaded, which is in the start of the server. Try to reload actions (/reload actions) and see if you get any syntax errors.

It might be "math.random(67)", I'm not entirely sure, but it should need two parameters.

Ignazio
 
I solved it!
I changed the name of the file. It was named Outfits.lua , I changed it to outifts.lua and now it works. But I don't get why I didn't get any error message earlier when starting the server up.
 
I solved it!
I changed the name of the file. It was named Outfits.lua , I changed it to outifts.lua and now it works. But I don't get why I didn't get any error message earlier when starting the server up.

I'm glad, as I mentioned earlier, the actions are loaded in a fashion that errors are not visible on the bottom console window, merely somewhere in the middle. Reloading actions when the server is online will show you more specific errors on the chosen reload type, might have been why.

Ignazio
 

Similar threads

Back
Top