wafuboe
Active Member
- Joined
- Dec 24, 2010
- Messages
- 884
- Solutions
- 2
- Reaction score
- 26
Hello i got this script, its supposed to teleport your summon to your location if it falls behind but i found this error in console.
Im using tfs 1.3, i think the script was from other tfs 1.2server i had..
i got this error on console
Im using tfs 1.3, i think the script was from other tfs 1.2server i had..
i got this error on console

Code:
function onThink(creature, interval)
local maxDistance = 7
local owner = creature:getMaster()
local petPosition = creature:getPosition()
local ownerPosition = owner:getPosition()
if petPosition.z ~= ownerPosition.z or ownerPosition:getDistance(petPosition) >= maxDistance then
petPosition:sendMagicEffect(CONST_ME_TELEPORT)
creature:teleportTo(ownerPosition)
creature:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
end
return true
end