• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

[Request]

Kanto

So.. you want a cookie?
Joined
Feb 28, 2008
Messages
90
Reaction score
0
Location
Jämtland. :)
I want a script that does: If you step on a tile you get a storage so you can open a door and when you step on the tile a text will be shown. And I also wanna know what to type on the door. :)

So if anyone could help me with this I would be really greatful and ofc I give rep++ :thumbup:
 
Last edited:
Ok save this file as tilestorage.lua in Movement place
PHP:
function onStepIn(cid, item, position, fromPosition) 
    if item.actionid == 999 and getPlayerStorageValue(cid, 5555) ~= 1 then 
        setPlayerStorageValue(cid, 5555, 1) 
    end 
    return TRUE 
end
In Movements.xml copy this
PHP:
<movevent type="StepIn" itemid="ITEM_ID_OF_STEP_IN" event="script" value="Tilestorage.lua"/>
Change ITEM_ID_OF_STEP_IN to the ID of the tile your using and change the action ID of the tile to 999.

For the door save it in actions as Storagedoor.lua
PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local cidPosition = getCreaturePosition(cid)
		if (item.actionid == 998 and getPlayerStorageValue(cid,5555) >= 1) then
			if cidPosition.x < toPosition.x then
				doTeleportThing(cid, {x=toPosition.x+1,y=toPosition.y,z=toPosition.z}, TRUE)
			else
				doTeleportThing(cid, {x=toPosition.x-1,y=toPosition.y,z=toPosition.z}, TRUE)
			end
			return TRUE
		else
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry you havent done the quest < CHANGE THIS.")
			return TRUE
	end
	return FALSE
end

In action.xml
PHP:
<action actionid="998" script="storagedoor.lua" />
Set the action id of door to 998
 
Last edited:
Ok save this file as tilestorage.lua in Movement place
PHP:
function onStepIn(cid, item, position, fromPosition) 
    if item.actionid == 999 and getPlayerStorageValue(cid, 5555) ~= TRUE then 
        setPlayerStorageValue(cid, 5555, 1) 
    end 
    return TRUE 
end

LUA:
function onStepIn(cid, item, position, fromPosition) 
    if getPlayerStorageValue(cid, 5555) ~= 1 then 
        setPlayerStorageValue(cid, 5555, 1) 
    end 
    return TRUE 
end
 
Back
Top