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

whats wrong with thi script ?

Lbtg

Advanced OT User
Joined
Nov 22, 2008
Messages
2,398
Reaction score
165
PHP:
local standPos = {x=980,y=966,z=7}
local newPos = {x=997,y=997,z=7}
 
function onSay(cid, param)
    if comparePos(getPlayerPosition(cid), standPos) then
        doSendMagicEffect(getPlayerPosition(cid), 2)
        doTeleportThing(cid, newPos)
        doSendMagicEffect(newPos, 10)
    end
    return 1
end

i use 0.3.6

error in console:
PHP:
[01/07/2011 18:59:28] [Error - TalkAction Interface] 
[01/07/2011 18:59:28] data/talkactions/scripts/tele.lua:onSay
[01/07/2011 18:59:28] Description: 
[01/07/2011 18:59:28] data/talkactions/scripts/tele.lua:5: attempt to call global 'comparePos' (a nil value)
[01/07/2011 18:59:28] stack traceback:
[01/07/2011 18:59:28] 	data/talkactions/scripts/tele.lua:5: in function <data/talkactions/scripts/tele.lua:4>

[01/07/2011 18:59:29] [Error - TalkAction Interface] 
[01/07/2011 18:59:29] data/talkactions/scripts/tele.lua:onSay
[01/07/2011 18:59:29] Description: 
[01/07/2011 18:59:29] data/talkactions/scripts/tele.lua:5: attempt to call global 'comparePos' (a nil value)
[01/07/2011 18:59:29] stack traceback:
[01/07/2011 18:59:29] 	data/talkactions/scripts/tele.lua:5: in function <data/talkactions/scripts/tele.lua:4>
 
can you remake this script so dont need this function ?
i know that this script was made on 0.2+
 
Code:
function onSay(cid, param)
    local pos = getPlayerPosition(cid)
    if pos.x == standPos.x and pos.y == standPos.y and pos.z == standPos.z then
        doSendMagicEffect(getPlayerPosition(cid), 2)
        doTeleportThing(cid, newPos)
        doSendMagicEffect(newPos, 10)
    end
    return 1
end
 
can you write in script same positions like in me script ? cuz i dont understand where i put them
 
You don't need to. The positions is automaticly authorized in the functions, or what? :o
For example:

Code:
getPlayerPosition

Will detect the position. Therefore the scripts wont be as affected by the map as if you enter a specific position ;)
Though you do not have comparePos

Code:
 function comparePos(a, b)
    return a.x == b.x and a.y == b.y and a.z == b.z
end
 
Back
Top