• 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 Convert script tfs 1.1 for tfs 1.0

Andreselos

Member
Joined
Feb 9, 2015
Messages
36
Reaction score
7
Hello guys, i need to convert this code:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if comparePos(player:getPosition(), Position(33614, 32394, 11)) then --change here the position
if target.itemid == 22638 then --change here the id of the target
item:remove(22604) -- change here the id of the key
end
player:teleportTo(Position(33533, 32414, 12), false)
end
return true
end

from 1.1 to 1.0 someone help me?
thanks in advance.

up
 
Last edited by a moderator:
For those who need ;)
working perfectly..

function doComparePositions(position, positionEx)
return position.x == positionEx.x and position.y == positionEx.y and position.z == positionEx.z
end

function onUse(cid, item, fromPosition, target, toPosition, isHotkey)
if doComparePositions(getPlayerPosition(cid), {x = 33614, y = 32394, z = 11}) then
if target.itemid == 22638 then
doRemoveItem(item.uid)
end
doTeleportThing(cid, {x = 33533, y = 32414, z = 12}, false)
end
return true
end
 
Back
Top