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

Ticket to go trough the door.

Snach

Sensei
Joined
Aug 8, 2009
Messages
1,694
Reaction score
84
Location
Estonia
I need a script for this:
Player buys a ticket form the npc (npc is done) and if you go trough the door then your ticket will be gone. And you cant go trough the door WITHOUT the ticket. Also if you buy the ticket you an go trough the door only one time. To go again then you need to buy a new ticket.
 
The door should be a quest- or experience door, so it close by itself when you move out from it.

ServerDirectory/mods/Ticket_Door.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Ticket_Door" version="1.0" author="Slaktaren" contact="my ass" enabled="yes">

	<action actionid="[COLOR="Red"]XXXX[/COLOR]" event="script"><![CDATA[
	
		local cfg = {
			action = [COLOR="Red"]XXXX[/COLOR], -- Action id of the door
			ticket_id = [COLOR="Red"]XXXX[/COLOR], -- ID of the ticket
			doorOpen_id = [COLOR="Red"]XXXX[/COLOR], -- ID of the door when it's open
			door_position = { posx = [COLOR="Red"]XXX[/COLOR], posy = [COLOR="Red"]YYY[/COLOR], posz = [COLOR="Red"]ZZZ[/COLOR] }, -- Position of the door
			cancel_message = "The door seems to be sealed against unwanted intruders.",
			cancel_message_type = MESSAGE_INFO_DESCR,
					}	
	
		if item.actionid == cfg.action then
			if getPlayerItemCount(cid, cfg.ticket_id) >= 1 then
				doTransformItem(item.uid, cfg.doorOpen_id)
				doTeleportThing(cid, cfg.door_position, TRUE)
			else
				doPlayerSendTextMessage(cid, cfg.cancel_message_type, cfg.cancel_message)
			end
		end
	return TRUE
	]]></action>
</mod>
 
It doesn't remove ticket. Tried to add it myself but I srsly suck at scripting =(
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Ticket_Door" version="1.0" author="Slaktaren" contact="my ass" enabled="yes">

<action actionid="7778" event="script"><![CDATA[

local cfg = {
action = 7778, -- Action id of the door
ticket_id = 5891, -- ID of the ticket
doorOpen_id = 1230, -- ID of the door when it's open
door_position = { posx = 692, posy = 683, posz = 8 }, -- Position of the door
cancel_message = "The door seems to be sealed against unwanted intruders.",
cancel_message_type = MESSAGE_INFO_DESCR,
}

if item.actionid == cfg.action then
if getPlayerItemCount(cid, cfg.ticket_id) >= 1 then
getCreaturePosition(param.cid)
doPlayerRemoveItem(item.id,5891,1)
doTransformItem(item.uid, cfg.doorOpen_id)
doTeleportThing(cid, cfg.door_position, TRUE)
else
doPlayerSendTextMessage(cid, cfg.cancel_message_type, cfg.cancel_message)
end
end
return TRUE
]]></action>
</mod>
 
Oh I forgot, here:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Ticket_Door" version="1.0" author="Slaktaren" contact="my ass" enabled="yes">

	<action actionid="7778" event="script"><![CDATA[
	
		local cfg = {
			action = 7778, -- Action id of the door
			ticket_id = 5891, -- ID of the ticket
			doorOpen_id = 1230, -- ID of the door when it's open
			door_position = { posx = 692, posy = 683, posz = 8 }, -- Position of the door
			cancel_message = "The door seems to be sealed against unwanted intruders.",
			cancel_message_type = MESSAGE_INFO_DESCR,
					}	
	
		if item.actionid == cfg.action then
			if getPlayerItemCount(cid, cfg.ticket_id) >= 1 then
				doTransformItem(item.uid, cfg.doorOpen_id)
				[COLOR="Red"]doPlayerRemoveItem(cid, cfg.ticket_id, 1)[/COLOR]
				doTeleportThing(cid, cfg.door_position, TRUE)
			else
				doPlayerSendTextMessage(cid, cfg.cancel_message_type, cfg.cancel_message)
			end
		end
	return TRUE
	]]></action>
</mod>
Added
 
Back
Top