• 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:
sec you mean when the player go on the first tp that should add storage valua he dosnt get message value was changed?
 
humm,let me say "Try again the script now", and tell me what goes wrong ,what happens when player with no storage walk in tp etc..
 
ok i got the error it was just with that high uniquid make it 9000 and 9001
and the mssage don't display i just fixed all now :p
 
ok i guess don't look for that script i wrote before here is the fixed one just edit what in movement and the positions
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 getPlayerLookDir(cid) == 0 then
         newdir = 2
     elseif getPlayerLookDir(cid) == 1 then
         newdir = 3
     elseif getPlayerLookDir(cid) == 2 then
         newdir = 0
     else
         newdir = 1
     end
    if item.uid == tpid then
      if getPlayerStorageValue(cid,storagevalue) ~= 1 then
         setPlayerStorageValue(cid, storagevalue, 1)
         doTeleportThing(cid,pos)
         doSendMagicEffect(getPlayerPosition(cid),10)
         doCreatureSay(cid, "You have got new storage.", TALKTYPE_ORANGE_1)
      else
        doPlayerSendCancel(cid,"You already got this storage.")
		doMoveCreature(cid, newdir)
      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)
		 doMoveCreature(cid, newdir)
      end
    end
end

pate this in movement
Code:
<movevent type="StepIn" uniqueid="9001" event="script" value="st.lua" />
    <movevent type="StepIn" uniqueid="9000" event="script" value="st.lua" />
 
Enter teleport - get storage.

Lua:
function onStepIn(cid, item, fromPosition, itemEx, toPosition)
local setStorage = 9899

	if(isPlayer(cid) == TRUE and getPlayerStorageValue(cid, setStorage) ~= 1) then
		doPlayerSetStorageValue(cid, setStorage, 1)
		doPlayerSendTextMessage(cid, 22, "Text when get the storage:)")
		return TRUE
	end
	if(isPlayer(cid) == TRUE and getPlayerStorageValue(cid, setStorage) == 1) then
		doPlayerSendTextMessage(cid, 22, "You\'ve already entered the secret teleport.")
		return TRUE
	end
	if(isPlayer(cid) ~= TRUE) then
		return FALSE
	end
	return TRUE
end
 
thnx alot zonet it really works :D but i want another scripte when the player got the stroge value from the upove scripte he enter another teleport with the storge value if he dont have entered the first tp and dont got the storge value then he cant enter the next tp :D.
 
thnx alot zonet it really works :D but i want another scripte when the player got the stroge value from the upove scripte he enter another teleport with the storge value if he dont have entered the first tp and dont got the storge value then he cant enter the next tp :D.

Already made that script before the other :huh:.
It should work.
 
Back
Top