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

Simple script

kimokimo

Kimo
Joined
Jan 25, 2011
Messages
821
Solutions
6
Reaction score
156
GitHub
karimadnan
hi

If player is in position x,y,z and have storage xxx then do teleport to position x,y,z if not then dont teleport :)
 
What I do is, I put a certain action id on a tile and use this:

Code:
local action = 33745
local goto = {x = 993, y = 996, z = 7}

	function onStepIn(cid, item, position, fromPosition)
if item.actionid == action then
doTeleportThing(cid, goto)
doPlayerSendMagicEffect(getPlayerPosition(cid), 37)
else

	end
return TRUE
end


Could you explain the reason a bit more as to why you want the script and I could help some more :)
 
Last edited:
u didnt understand i want to make a door that players wont be able to pass until they do a quest that will give them a storage so they can pass but they have to stand south from door to pass and if they are in there they cant go out.
 
Try it, I don't know if it will work.

LUA:
local pos = {x = 1, y = 1, z = 1}

function onStepIn(cid, item, position, fromPosition)
local p = getPlayerPosition(cid)
local pos = variantToPosition(var) 

	if item.actionid == ACTIONID then
		if(pos.x == x and pos.y == y poz.z == z)
			if getPlayerStorageValue(cid, xxx) == 1 then
				doTeleportThing(cid, pos)
				doSendMagicEffect(p, CONST_ME_TELEPORT)
			else
				doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry it's not possible.")
			end
		end
	end
return TRUE
end


@door version

LUA:
local pos = {x = 1, y = 1, z = 1}

function onUse(cid, item, fromPosition, itemEx, toPosition)
local p = getPlayerPosition(cid)
 
if item.actionid == ACTIONID then
	if getPlayerStorageValue(cid, xxx) < 1 then
		doTeleportThing(cid, pos)
		doSendMagicEffect(p, CONST_ME_TELEPORT)
		getPlayerStorageValue(cid, XXX, 1)
	else
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry it's not possible.")
	end
end
return TRUE
end
 
Last edited:
Ok what about this?

Code:
local id = 10001
local storage = 22222
local place = {x= 1, y, = 1, z = 1}

function onStepIn(cid, item, position, fromposition)
	if item.actionid == id and getPlayerStorageValue(cid) == storage then
	doTeleportThing(cid, place)
	doSendMagicEffect(getplayerposition(cid), 37)
	doPlayerSetStorageValue(cid, 10000)
elseif getPlayerStorageValue(cid) ~= storage then
	doPlayerSendTextMessage("You need to complete XXXXX to enter here", MESSAGE_STATUS_BLUE_CONSOLE)

	end
end
 
You dont need to have it if they're not standing there.

In map editor, change the door/tiles to actionid 10001 or whatever id you put.
 
Back
Top