• 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 TFS 1.1 Old Functions Script Problem!

Xarly

Member
Joined
Mar 9, 2015
Messages
360
Reaction score
20
Hello guys im tryng to register on login.lua some things but the distro give me a error im tryng to do that on login.lua
registerCreatureEvent(cid, "Wyda")
registerCreatureEvent(cid, "Raging Mage")
registerCreatureEvent(cid, "Raging Mage2")
registerCreatureEvent(cid, "White Deer")
registerCreatureEvent(cid, "White Deer2")
registerCreatureEvent(cid, "Northern Pike")
registerCreatureEvent(cid, "Gaz'haragoth Heal")
registerCreatureEvent(cid, "Omrafir Explode")
registerCreatureEvent(cid, "Shlorg Tp")
registerCreatureEvent(cid, "Welter Egg")
registerCreatureEvent(cid, "The Pale Count Tp")
registerCreatureEvent(cid, "Test Heal")
registerCreatureEvent(cid, "Zavarash Hide")
registerCreatureEvent(cid, "Monster Heal")
registerCreatureEvent(cid, "Monster Heal2")
registerCreatureEvent(cid, "Nomad")

and im getting this error on the distro TFS 1.1:
2hsawt1.png


i hope someone can help me thanks guys
 
Do you reload creaturescripts or restart the server? if you reload, try to restart it.
Btw that script is a short version of http://pastebin.com/0kW6Pac3

For the other one.
Code:
function onDeath(creature, corpse, killer, mostDamageKiller, unjustified, mostDamageUnjustified)
     creature:say("I WILL RETURN!! My death will just be a door to await my homecoming, my physical hull will be... my... argh...", TALKTYPE_MONSTER_YELL)
end
works perfect bro! xd, the only problem its the collapse portal >.< they wont colapse and no error son the distro im using that scripts
raging.lua: http://pastebin.com/rVGWyVbx
energized.lua: http://pastebin.com/P8w80LdH
yielothax.lua http://pastebin.com/ZMZYJTWp

and yes i reload and restarted tfs >.< thanks for your help!
 
Code:
if target:isMonster() then
You can change the other functions by using compat.lua as example.

Code:
function onKill(player, target)
Then target:getName() etc, if you have problem with any function, post it.
 
Last edited:
Code:
if target:isMonster() then
You can change the other functions by using compat.lua as example.

Code:
function onKill(player, target)
Then player:getName() etc, if you have problem with any function, post it.
hello mate, well i added the onkill and ismonster functions but the script still not working without errors on distro >.<
 
You can add print to see if it's executing/loading the changes.
Code:
print("test")

Use this instead of isMonster(target)
Code:
if target:isMonster() then
 
You can add print to see if it's executing/loading the changes.
Code:
print("test")

Use this instead of isMonster(target)
Code:
if target:isMonster() then
i used
if target:isMonster() then instead of ismonster(target) and added print but still not working and without errors on distro

its rare because worked perfect yesterday on my other otserver with tfs 1.0 but on that ot with tfs 1.1 not work :S
 
With this you can do more tests to see where it goes wrong, add it under the if statement for example, look which messages you get.
 
With this you can do more tests to see where it goes wrong, add it under the if statement for example, look which messages you get.
well i only see test print if i put up of function onKill(creature, target) if i put down of function onKill(creature, target) not test print >.< i tried adding some codes of compat but not work i rlly dont know how to fix it im so noob xd
 
Use the compat.lua as example to change the TFS 0.2 functions to TFS 1.1 functions.
Restart your server after making changes and look if you get the print messages under function onKill then.
 
Use the compat.lua as example to change the TFS 0.2 functions to TFS 1.1 functions.
Restart your server after making changes and look if you get the print messages under function onKill then.
well im tryng doing that i changed some things u can see but still not getting test print>.< :S

function onKill(player, target)
print("test")
if(isMonster(target)) then
if(string.lower(getCreatureName(cid)) == "raging mage") then
Game.broadcastMessage("The remains of the Raging Mage are scattered on the floor of his Tower. The dimensional portal quakes.", MESSAGE_EVENT_ADVANCE)
doCreatureSay(cid, "I WILL RETURN!! My death will just be a door to await my homecoming, my physical hull will be... my... argh...", TALKTYPE_ORANGE_1)
registerCreatureEvent(doRemoveItem, 5 * 60 * 1000, getTileItemById({x = 33143, y = 31527, z = 2}, 11796).uid, 1)
registerCreatureEvent(broadcastMessage, 5 * 60 * 1000, "With a great bang the dimensional portal in Zao collapsed and with it the connection to the other dimension shattered.", MESSAGE_EVENT_ADVANCE)
end
end
return true
end

Use the compat.lua as example to change the TFS 0.2 functions to TFS 1.1 functions.
Restart your server after making changes and look if you get the print messages under function onKill then.
if u can pls chang eit for me mate >.< i rlly cant know how to make it because idk what its the old function / new aniway using ocmpat :S

Use the compat.lua as example to change the TFS 0.2 functions to TFS 1.1 functions.
Restart your server after making changes and look if you get the print messages under function onKill then.
or if u can let me know where exactly i can compare old/new functions because with the compat.lua only ic an't do that and its rlly hard fo rme... thanks

Code:
if target:isMonster() then
You can change the other functions by using compat.lua as example.

Code:
function onKill(player, target)
Then player:getName() etc, if you have problem with any function, post it.
the problem its here i think if(string.lower(getCreatureName(cid)) == "raging mage") then
but idk how to change >.<

Use the compat.lua as example to change the TFS 0.2 functions to TFS 1.1 functions.
Restart your server after making changes and look if you get the print messages under function onKill then.
tried 1000 things and still can't fixing it :/ please limos if u can help me i have all the day breaking my head with that for nothing :/ thanks
 
Last edited by a moderator:
What exactly don't you understand?
You see this: getCreatureName(cid), then you look in compat.lua and you find this.
https://github.com/otland/forgottenserver/blob/master/data/lib/compat/compat.lua#L69

function getCreatureName(cid) local c = Creature(cid) return c ~= nil and c:getName() or false end

Creature(cid) is creature userdata, target in function onKill is also creature userdata, so you can just use that.
So then it will be: target:getName()
 
Last edited:
What exactly don't you understand?
You see this: getCreatureName(cid), then you look in compat.lua and you find this.
https://github.com/otland/forgottenserver/blob/master/data/lib/compat/compat.lua#L69

function getCreatureName(cid) local c = Creature(cid) return c ~= nil and c:getName() or false end

Creature(cid) is creature userdata, player in function onKill is also creature userdata, so you can just use that.
So then it will be: player:getName()
so it will be if(string.lower(player:getName()) == "raging mage") then right? because i rlly understand where to put player:getName() :S
 
if(string.lower(player:getName()) == "raging mage") then
broadcastMessage("The remains of the Raging Mage are scattered on the floor of his Tower. The dimensional portal quakes.", MESSAGE_EVENT_ADVANCE)
doCreatureSay(cid, "I WILL RETURN!! My death will just be a door to await my homecoming, my physical hull will be... my... argh...", TALKTYPE_ORANGE_1)
addEvent(doRemoveItem, 5 * 60 * 1000, getTileItemById({x = 33143, y = 31527, z = 2}, 11796).uid, 1)
addEvent(broadcastMessage, 5 * 60 * 1000, "With a great bang the dimensional portal in Zao collapsed and with it the connection to the other dimension shattered.", MESSAGE_EVENT_ADVANCE)

that are the rest of functions i checked on compat.lua for addEvent and can't find anything and the rest of functions can't find them on compat aniway if i add print down of if(isMonster(target)) then that don't print test on distro >.< and still not working :S
 
Code:
player:say("I WILL RETURN!! My death will just be a door to await my homecoming, my physical hull will be... my... argh...", TALKTYPE_MONSTER_SAY)
 
Back
Top