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

Teleport with storge value

Nemo2010

Member
Joined
Jun 12, 2009
Messages
255
Reaction score
13
Location
Somewhere@otland
Hey guys...

1-I want a scripte that when player pass through a certain tp he got a storge value,
and when he got the storge value he can enter another tp and if he dont got the storge value he can't enter the tp with a msg sorry u cant enter here.

I Hope any one from otland helps me.
:wub:

I hope that explained more better JDB.

Your's
Nemo
 
Last edited:
Movements

Lua:
local access = 1233
local truePos = { x=100, y=100, z=7 } -- position if able to enter
local falsePos = { x=100, y=100, z=7 } -- position of not able to enter

function onStepIn(cid, item, fromPosition, itemEx, toPosition)
local storage = getPlayerStorageValue(cid, access)
	if (storage == 1) then
		doTeleportThing(cid, truePos)
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
		doSendAnimatedText(getCreaturePosition(cid), "Welcome", TEXTCOLOR_RED)
	else
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
		doPlayerSendCancel(cid, "You may not enter this teleport.")
	end
	return true
end
 
HAven't tested but should work
Code:
function onStepIn(cid, item, position, fromPosition)
	local config = {
storage1 = 1111,
FirstUid = 1111,
kickpos = {x=1234, y=1232, z=2, stackpos=1 },
SecondUid = 2222
}
	if (item.uid == config.FirstUid) and (getPlayerStorageValue(cid, config.storage1) == 0) then
		setPlayerStorageValue(cid, config.storage1, 1)
	
	elseif (item.uid == config.SecondUid) and (getPlayerStorageValue(cid, config.storage1) == 1) then
		doPlayerSendTextMessage(cid, 25, "You can pass here.")
	else	
		doPlayerSendCancel(cid, "You can't pass here!")
		doTeleportThing(cid, config.kickpos)
	end
		
return true
end
 
kk tell me steps to test it where i put and with unique id or action?!!

storage1 = 1111 --- storage that gives you first tp
FirstUid = 1111 ---put this unique id on first teleport on map
kickpos = {x=1234, y=1232, z=2, stackpos=1 } -- position where player without storage value will be kicked

SecondUid = 2222 -- put this unique id on tp that requires you to have a storage value
 
all of that is good but i want if player got the storge value he teleported to a certain place(x=,y=,z=)

and the player dont have storge value he stays in his place and remove out from tp in the same place not teleported to another place...

and where is the first tp that player pass through it and get the storge value first...?

i hope u make it
 
create new file in movements/scripts/scriptName.lua
Lua:
function onStepIn(cid, item, fromPosition, itemEx, toPosition)
local storageValue = 2598 -- storageValue player should have to enter tp.
local teleportPos = {x=100, y=100, z=7} -- if storageValue == 1, where should he get teleported?


	if(getPlayerStorageValue(cid, storageValue) ~= 1) then
		doPlayerSendCancel(cid, "You dont have access to enter this teleport")
		doTeleportThing(cid, fromPosition)
		return TRUE
	end
	if(getPlayerStorageValue(cid, storageValue) == 1) then
		doTeleportThing(cid, teleportPos)
		end
		return TRUE
	end

movement.xml

Code:
    <movevent type="StepIn" uniqueid="12465" event="script" value="scriptName.lua" />

Also this teleports you only if you got that "X" storage.
 
all of that good zonet but also if the player got the storge value he dont enter the tp.

also i have requested another scripte that when u enter the tp gives u storge value that let u enter the other tp,
 
Last edited:
ok try this
Lua:
local storagevalue = 1950 --storage value you will give to player

local tpid = 9000  --unique of the tp that give storage value
local pos = {x=xxxx,y=xxxx,z=x} --location where the tp that give storage will tp player

local tpid2 = 9001  --unique id of the other tp that when player have the required storgae they will be tped
local pos2 = {x=xxxx,y=xxxx,z=x}
function onStepIn(cid, item, fromPosition, itemEx, toPosition)
   
    if item.uid == tpid then
      if getPlayerStorageValue(cid,storagevalue) ~= 1 then
         setPlayerStorageValue(cid, storagevalue, 1)
         doTeleportThing(cid,pos)
         doSendMagicEffect(getPlayerPosition(cid),10)
         doPlayerSendTextMessage(cid,20,"now You have got a new storage value.")
      else
         doSendTextMessage(cid,"you already got you storage")
      end
    end
    if item.uid == tpid2 then  
      if getPlayerStorageValue(cid,storagevalue) == 1 then
         doTeleportThing(cid,pos2)
         doSendMagicEffect(getPlayerPosition(cid),10)
      else
         doPlayerSendCancel(cid,"you don't have the required storage")
         doTeleportThing(cid, fromPosition)
      end
    end
end
in movement add this
Code:
<movevent type="StepIn" uniqueid="9000" event="script" value="scriptName.lua" />
<movevent type="StepIn" uniqueid="9001" event="script" value="scriptName.lua" />


i dodnt test maybe be some errors try.
This first tp will set the players a storage value if they dont have it and will send them a text mssage that they recieved it
The second one will tp player if they have the storage value
if not they will be pushed back and will get a mssage you dont have the required storage value
 
Last edited:
Back
Top