Hello!
I was playing a game to complete missions, however there were two types of entrances for places. Private entrance and the public entrance, in which the private entrance only players in party can enter.
Has two vacancies for private entrance. If both are busy you will compulsorily public entrance.
Or if you want you can join a party to join the private entrances.
I want this NPC to my server ...
I started the script, but I'm newbie
I was playing a game to complete missions, however there were two types of entrances for places. Private entrance and the public entrance, in which the private entrance only players in party can enter.
Has two vacancies for private entrance. If both are busy you will compulsorily public entrance.
Or if you want you can join a party to join the private entrances.
I want this NPC to my server ...
Code:
local public = doTeleportThing(cid, x=100, y=100, z=7)
local private1 = doTeleportThing(cid, x=200, y=200, z=7)
local private2 = doTeleportThing(cid, x=300, y=300, z=7)
if msgcontains(msg, "public entrance") then
talkState[talkUser] = 1
selfSay("You want to go to the mountains in the public mode?", cid)
if msgcontains(msg, "yes") and talkState[talkUser] == 1 then
selfSay("Good luck!", cid)
doTeleportThing(cid, publicEntrande)
elseif msgcontains(msg, "no") and talkState[talkUser] == 1 then
selfSay("I would do the same as you!", cid)
end
elseif msgcontains(msg, "private entrance") then
talkState[talkUser] = 1
selfSay("You want to go to the mountains in party mode?", cid)
if msgcontains(msg, "yes") and talkState[talkUser] == 1 then
if isInParty(cid) == TRUE then
if getCreaturePosition(getPartyLeader(cid)) == {fromx=200, fromy=200, fromz=7, tox=299, toy=299, toz=7} then
doTeleportThing(cid, private1)
selfSay("Good luck!", cid)
elseif getCreaturePosition(getPartyLeader(cid)) == {fromx=300, fromy=300, fromz=7, tox=399, toy=399, toz=7} then
doTeleportThing(cid, private2)
selfSay("Good luck!", cid)
else
selfSay("The leader of your group is not in any of the two entrances.", cid)
end
else
selfSay("You are not in a party.", cid)
end
elseif msgcontains(msg, "no") and talkState[talkUser] == 1 then
selfSay("I would do the same as you!", cid)
end
end
I started the script, but I'm newbie