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

[tfs 0.3.6]Storage ID doors,telepot activated after getting a Storage ID. lever st id

SonGoqu

New Member
Joined
Nov 27, 2008
Messages
64
Reaction score
0
Hello,
I need 3 scripts:

1. doors that can everyone pass without player with Storage ID 11001
2. teleport that is active only for players that get a Storage ID 11002
3. lever (1945) that after change to 1946 give the player Storage ID 11003

Thanx for help.
 
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.itemid == CLOSED_DOOR_ID then
		if getCreatureStorage(cid, 11001) == -1 then
			doTransformItem(item.uid, item.itemid + 1)
			doTeleportThing(cid, toPosition)
		else
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The door seems to be sealed against unwanted intruders.")
		end
		return true
	end
end
Lua:
function onStepIn(cid, item, position, fromPosition)
	if getCreatureStorage(cid, 11002) ~= -1 then
		doTeleportThing(cid, {x=100, y=100, z=7}) -- has storage
	else
		doTeleportThing(cid, {x=100, y=100, z=7}) -- doesn't have
	end
	doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
	doSendMagicEffect(position, CONST_ME_TELEPORT)
end
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.itemid == 1945 then
		doCreatureSetStorage(cid, 11003, 1)
	end
end
add in ActionID in quest door on mapeditor.

1. doors that can everyone pass without player with Storage ID 11001
without?
 
Last edited:
1. doors that can everyone pass without player with Storage ID 11001 - Yes when someone make a quest and get this storage: 11001, he can't pass a door


Thank you Cykotitan

I must a little modify the script/lua for the doors, then after open the door want close, this is my version:

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
        if getCreatureStorage(cid, 11001) == -1 then
                if getCreaturePosition(cid).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
                doCreatureSay(cid, "Now GOOD LUCK!", TALKTYPE_ORANGE_1)
                doSendMagicEffect(getCreaturePosition(cid), 10)
        else
                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, but you already pass this quest.")
        end
        return TRUE
end
 
Last edited:
I have a question to the script for the lever:
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.itemid == 1945 then
		doCreatureSetStorage(cid, 20001, 1)
	end
end

how to do, that after the player switch the lever he see the information "the teleport ist activated" and when the player have already activated this teleport (get storage 20001) he will see the info "the teleport is already activated"?
 
how to do, that after the player switch the lever he see the information "the teleport ist activated" and when the player have already activated this teleport (get storage 20001) he will see the info "the teleport is already activated"?[/B]

Lua:
local storage = 20001
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.itemid == 1945 and getCreatureStorage(cid, storage) <= -1 then
		doCreatureSetStorage(cid, storage, 1)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The teleport is creating...")
    return doTransformItem(item.uid, 1946)
    end
	doTransformItem(item.uid, 1945)
	return doPlayerSendCancel(cid,"The teleport is already activated, you cannot activate this now.")
	end
 
Last edited:
Lua:
local storage = 20001
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.itemid == 1945 and getCreatureStorage(cid, storage) <= -1 then
		doCreatureSetStorage(cid, storage, 1)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The teleport is creating...")
    return doTransformItem(item.uid, 1946)
    end
	doTransformItem(item.uid, 1945)
	return doPlayerSendCancel(cid,"The teleport is already activated, you cannot activate this now.")
	end

Thx, it works perfect !!!
 
Back
Top