• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

MoveEvent Teleport set storagevalue

Thunder Beam

New Member
Joined
Apr 23, 2008
Messages
107
Reaction score
0
Hello,

I need a script that if you go trough a teleporter, you get a Storagevalue.
After that you go to a hall where several teleporters are and if you want to go trough those teleporters, you need that special storagevalue ! (like real inquisition)

I used the search function but nothing usefull was found.

Thanks in advance

Thunder Beam
 
Last edited:
Just give the teleporter a uniqueid. (12345)

Then, in movements.xml, add:

Code:
<movevent type="StepIn" uniqueid="12345" event="script" value="tpstorage.lua"/>

Then, in /movements/scripts make a file and name it "tpstorage.lua". Put this in it:

Code:
function onStepIn(cid, item, position, fromPosition)
	if getPlayerStorageValue(cid,12345) <= 0 then
		setPlayerStorageValue(cid, 12345, 1)
	end
return true
end

That's just to set the storage value.
////////////////////////////////////////////////////////////////

To make it so they need a certain storage value to step in the portal, you should do something like:

movements.xml:

Code:
<movevent type="StepIn" uniqueid="12346" event="script" value="inquisition.lua"/>

Then, in inquisition.lua (make sure the tp you are limiting them from has the uniqueid '12346'.

Code:
function onStepIn(cid, item, position, fromPosition)
	if getPlayerStorageValue(cid, 12346) >= 1 then
		return true
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, you do not meet the requirements to go in this portal.")
		doTeleportThing(cid, fromPosition, false)
	end
end
 
Last edited:
Thanks ! I'll test it :)

@ Edit:

Doesn't work, I have TFS 0.3.5 pl1

if i go in the teleport which has to check my storage, it copy me and teleport just to the position, and tekst msg: Sorry, you do not meet the requirements to go in this portal.

fix please !
 
Last edited:
Back
Top