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

Tile[by storage] help?

Michy

Member
Joined
May 20, 2010
Messages
105
Reaction score
6
Hi, well I want a script that is: if you have this "getPlayerStorageValue (cid, 63215)" or " OUTFIT?" can step on this floor: 4609, 4613, 4608, 4612, 4664 and can not step on the floor when you have the storage "getPlayerStorageValue ( cid, 63215) "4644, 4645, 4646, 4647.

Is it possible?
Help please
Sorry for my English but translated into google ...

---------------------------------Español---------------------
Hola, bueno yo quisiera un script que consiste en;
Si tienes este:"getPlayerStorageValue(cid, 63215)" pueda pisar este piso : 4609, 4613, 4608, 4612, 4664.
Y que no pueda pisar este piso cuando tiene el storage "getPlayerStorageValue(cid, 63215)" or "OUTFIT?"4644, 4645, 4646, 4647.

Es posible?
Ayuda por favor
Lo siento por mi ingles pero traduci en google...
 
Last edited:
[video=youtube;6-hXjNBZaH0]http://www.youtube.com/watch?v=6-hXjNBZaH0&feature=player_embedded[/video]



And as he did so only people with that outfit might step on the edge? ! That is not walkable?

I need your reply
 
easy:

Lua:
function onStepIn(cid, fromposition, toposition)

if item.id 4609 then
  if getPlayerStorageValue(cid,63215) then
  doPlayerSendCancel(cid, "You can pass.")
else
   doPlayerSendCancel(cid, "You dont have permission to pass here.")
doTeleportThing(cid,fromposition) 
end
return TRUE
end

Basic LUA
 
Script:
Lua:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	
	local storage = getCreatureStorage(cid, 63215)
	local allowed = {4609, 4613, 4608, 4612, 4664}
	local notAllowed = {4644, 4645, 4646, 4647}
	
	if(isInArray(allowed, item.id) and (storage == 1)) then
		doPlayerSendCancel(cid, "You can pass.")
	elseif(isInArray(notAllowed, item.id) and (storage == 1)) then
		doPlayerSendCancel(cid, "You dont have permission to pass here.")
		doTeleportThing(cid, lastPosition)		
	end
	return TRUE
end
Movements.xml:
Code:
	<!-- Allowed -->
	<movevent type="StepIn" itemid="4608-4609" event="script" value="[COLOR="red"]your'sNameOfScript[/COLOR].lua"/>
	<movevent type="StepIn" itemid="4612-4613" event="script" value="[COLOR="red"]your'sNameOfScript[/COLOR].lua"/>
	<movevent type="StepIn" itemid="4664" event="script" value="[COLOR="red"]your'sNameOfScript[/COLOR].lua"/>
	
	<!-- Not allowed -->
	<movevent type="StepIn" itemid="4644-4647" event="script" value="[COLOR="red"]your'sNameOfScript[/COLOR].lua"/>

I'm not sure that it will work. But try.
 
Last edited:
I think you all failed a little bit. :p

Lua:
local storage, outfit = XXXX, {lookType = XXX}
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if getPlayerStorageValue(cid, storage) < 0 then
		if getCreatureOutfit(cid) ~= outfit.lookType then
			doTeleportThing(cid, fromPosition, false)
		end
	end
	
	return true
end
 
I think you all failed a little bit. :p

Lua:
local storage, outfit = XXXX, {lookType = XXX}
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if getPlayerStorageValue(cid, storage) < 0 then
		if getCreatureOutfit(cid) ~= outfit.lookType then
			doTeleportThing(cid, fromPosition, false)
		end
	end
	
	return true
end
How smart. And if a monster steps there?
I know it won't cause an error, but you should still check

Also getCreatureOutfit(cid).lookType
 
How smart. And if a monster steps there?

I don't think a monster can walk off water, onto a wooden floor. :(

But...

Lua:
local storage, outfit = XXXX, {lookType = XXX}
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if isPlayer(cid) then
		if getPlayerStorageValue(cid, storage) < 0 then
			if getCreatureOutfit(cid).lookType ~= outfit.lookType then
				doTeleportThing(cid, fromPosition, false)
			end
		end
	end
	
	return true
end

Thanks for fix on getCreatureOutfit(cid).lookType :p
 

Similar threads

Back
Top