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

If have storage, can use teleport.

kito2

www.masteria.net
Joined
Mar 9, 2009
Messages
3,764
Solutions
1
Reaction score
227
Location
Chile, Santiago
Hey there... I tried to make an script but couldn't...

The idea is when the player stepIn, the script checks the storage X, if he has it = 1, then he gets teleported where the teleport is setted, if he doesnt, he is teleported back to Y coords.
 
LUA:
local storage = 1994 --storage number to be checked
local pos = {x=xxx,y=xxx,z=x} ---the place he will be teleporrted if check storageis false
local pos1 = {x=xxx,y=xxx,z=x} --place where he be tped if storage is true
function onStepIn(cid, item, position, fromPosition)
 if getPlayerStorageValue(cid,storage) ~= 1 then
   doTeleportThing(cid,pos)
   doSendMagicEffect(getPlayerPosition(cid),10)
 return true
 end
 if getPlayerStorageValue(cid,storage) == 1 then
   doTeleportThing(cid,pos1)
   doSendMagicEffect(getPlayerPosition(cid),10)
 return true
 end
end
and go add onstepin and out in movement.xml
that is it as far as i understood
 
Almost, the thing is that I have lot of teleports with different coords, so I need to make a unique scripts that check the same uid and then the player gets teleported to the tps coords.

local pos1 = {x=xxx,y=xxx,z=x} --place where he be tped if storage is true
doTeleportThing(cid,pos1)

These lines shouldn't go, and should be replaced by the teleports coords.
 
Last edited:
Code:
local storage = 1111
local pos = {x=111, y=111, z=7}
function onStepIn(cid, item, position, fromPosition)
	if getPlayerStorageValue(cid, storage) ~= -1 then
		doTeleportThing(cid, pos)
		doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
	else
		doTeleportThing(cid, fromPosition)
	end
return true
end

or

Code:
local pos = {
		[5000] = {{x=111, y=111, z=7}},
		[5001] = {{x=112, y=112, z=7}},
		[5002] = {{x=113, y=113, z=7}}
		}
function onStepIn(cid, item, position, fromPosition)
	if getPlayerStorageValue(cid, item.uid) ~= -1 then
		doTeleportThing(cid, pos[item.uid][1])
		doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
	else
		doTeleportThing(cid, fromPosition)
	end
return true
end

?
 
Code:
function onStepIn(cid, item, position, fromPosition)
	return getPlayerStorageValue(cid, item.uid) ~= -1 and doTeleportThing(cid, {x=111, y=111, z=7}) or doTeleportThing(cid, fromPosition)
end
 
Code:
function onStepIn(cid, item, position, fromPosition)
	doTeleportThing(cid, getPlayerStorageValue(cid, item.uid) > 0 and {x=111, y=111, z=7} or fromPosition)
end
?
 
I tested this one:

LUA:
local storage = 1111
local pos = {x=111, y=111, z=7}
function onStepIn(cid, item, position, fromPosition)
	if getPlayerStorageValue(cid, storage) ~= -1 then
		doTeleportThing(cid, pos)
		doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
	else
		doTeleportThing(cid, fromPosition)
	end
return true
end

But when adding the movements, it doesnt work because it is a teleport...
When the player stepIn the teleport, it should check the storage, if he has == 1, he should be teleported to the teleport position coords, if not, he should be teleported to 'pos'.
 
Don't worry Im using:

local pos = {
[5000] = {{x=111, y=111, z=7}},
[5001] = {{x=112, y=112, z=7}},
[5002] = {{x=113, y=113, z=7}}
}
function onStepIn(cid, item, position, fromPosition)
if getPlayerStorageValue(cid, item.aid) ~= -1 then
doTeleportThing(cid, pos[item.uid][1])
doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
else
doTeleportThing(cid, fromPosition)
end
return true
end

movement on a tile with actionid = storage that I want to check and with the uniqueid that I want for a new pos.

Thanks and repped Sypher!
 
Last edited:
Back
Top