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

Script teleport creature dont work

adamox223

New Member
Joined
Oct 21, 2017
Messages
100
Reaction score
4
Hello, i have problem, i need this script, and this dont work, and dont error in console, i dont know why...
can anyone help?
tfs 0.3.6

Code:
local t = {
    -- Monster Name,    Teleport To Position
    ["angry wolf"] = {x = 4950, y = 5392, z = 5}
}

function onKill(cid, target, lastHit)
    if isMonster(target) and getCreatureMaster(target) == target then
        local k = t[getCreatureName(target)]
        if k then
            doTeleportThing(cid, k)
            doSendMagicEffect(k, CONST_ME_TELEPORT)   
        end
    end
    return true
end

CREATURESCRIPTS:

Code:
<event type="kill" name="teleport" event="script" value="teleport.lua"/>

and login lua: registerCreatureEvent(cid, "teleport")


Help, please...
 
Solution
Have you tried printing the return value of getCreatureMaster function?

Let's say that it worked returning target as the master of target and you got upto the table, if the index is lowercase then so should be the inquiry.

Example:
Code:
local k = t[getCreatureName(target):lower()]
Have you tried printing the return value of getCreatureMaster function?

Let's say that it worked returning target as the master of target and you got upto the table, if the index is lowercase then so should be the inquiry.

Example:
Code:
local k = t[getCreatureName(target):lower()]
 
Solution
Back
Top