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

Teleport storage value

white91

New Member
Joined
Jun 4, 2008
Messages
136
Reaction score
0
Hello i need script when player go into teleport his storage value will be set to xxxx.
 
In movements:

PHP:
local pos = {x=63, y=120, z=7}
local Stor = 9090
local StorValue = 1
local pos = getPlayerPosition(cid)
function onStepIn(cid, item, position, fromPosition)
	if item.actionid == 250 and isPlayer(cid) == 1 then
		setPlayerStorageValue(cid, Stor, StorValue)
		doTeleportThing(cid,backpos)
		doSendMagicEffect(backpos,10)
		doSendMagicEffect(pos,10)
	end
end
 
[20/01/2009 15:14:17] Lua Script Error: [MoveEvents Interface]
[20/01/2009 15:14:17] data/movements/scripts/teleport.lua

[20/01/2009 15:14:17] luaGetCreaturePosition(). Creature not found
 
Put pos (with (cid)) under 'function onStepIn(...)' and rename it to playerPos or w/e, since pos is already in use.
 
PHP:
local pos = {x=63, y=120, z=7}
local Stor = 9090
local StorValue = 1
local Playerpos = getPlayerPosition(cid)
function onStepIn(cid, item, position, fromPosition)
    if item.actionid == 250 and isPlayer(cid) == 1 then
        setPlayerStorageValue(cid, Stor, StorValue)
        doTeleportThing(cid,pos)
        doSendMagicEffect(pos,10)
        doSendMagicEffect(Playerpos,10)
    end
end
 
Last edited:
[21/01/2009 02:45:18] Lua Script Error: [MoveEvents Interface]
[21/01/2009 02:45:18] data/movements/scripts/inq1.lua

[21/01/2009 02:45:18] luaGetCreaturePosition(). Creature not found

again
 
Sorry i forget to edit one thing :D

PHP:
local pos = {x=63, y=120, z=7}
local Stor = 9090
local StorValue = 1
local Playerpos = getPlayerPosition(cid)
function onStepIn(cid, item, position, fromPosition)
    if item.actionid == 250 and isPlayer(cid) == 1 then
        setPlayerStorageValue(cid, Stor, StorValue)
        doTeleportThing(cid,pos)
        doSendMagicEffect(pos,10)
        doSendMagicEffect(Playerpos,10)
    end
end
 
That won't do either as the error lies in the playerPos variable line. It should be inside the function.
PHP:
local pos = {x=63, y=120, z=7}

function onStepIn(cid, item, position, fromPosition)
    if isPlayer(cid) == 1 then
        setPlayerStorageValue(cid, 9090, 1)
    local Playerpos = getPlayerPosition(cid)
        doSendMagicEffect(Playerpos, 2)
        doTeleportThing(cid, pos)
        doSendMagicEffect(pos, 10)
    end
end
 
Back
Top