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

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
Hi there, like topic name says, I would like to know if someone could make an script that if a teleport has this actionID, it checks a storage, if the player has it setted to 1, he can use the teleport, if he doesnt, it will appear a message saying "you can't use this teleport yet."

PD: Also, I was wondering, when I set uniqueID on a chest with actionID 2000, this uniqueID is the storage and then it is setted to 1 right?
 
I'll give you this script in a few mins;
and about the question, I think yes.

EDIT, alright , here's the script:
LUA:
function onStepIn(cid, item, pos)

local ztorag = 25555 -- Storage value thats needed to pass
local cancelPos = {x=1539, y=1541, z=7} -- Where the player will go if he CANT enter teleport and steps on it
local tpPos = {x=1538, y=1536, z=7} -- Where the player will go if he CAN pass through
local playerPos = getPlayerPosition(cid)

		if getCreatureStorage(cid, ztorag) == 1 then
			doPlayerSendTextMessage(cid,22,"You have been teleported.")
           		doTeleportThing(cid, tpPos, 1)
			doSendMagicEffect(getCreaturePosition(cid),10)
		else
			doPlayerSendTextMessage(cid,22,"Sorry, you can't use this teleport yet.")
			doSendMagicEffect(getCreaturePosition(cid),2)
           		doTeleportThing(cid, cancelPos, 1)
		end
	return TRUE
end

I hope I helped.
 
Last edited:
It was closely, but I want a script that to all teleport that I set that actionID checks the storage, if the storage is right, it teleport where the teleport coords are setted, if doesnt, it moves you back of the teleport.

Anyways repped because it works :)
 
LUA:
function onStepIn(cid, item, frompos, item2, topos)
local storage = 25555
local tpPos = {x = 100, y= 200, z= 7} -- edit them
 if getPlayerStorageValue(cid, storage) == -1 and item.actionid == 2313 then
    doTeleportThing(cid, tpPos)
    doSendMagicEffect(getCreaturePosition(cid), 10)
 else
    doTeleportThing(cid, frompos)
    doSendMagicEffect(getCreaturePosition(cid), 2)
 end
end

Rep++:thumbup:
 
Back
Top