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

Need help - Quests with outfit

Massen

Masserv RPG
Joined
Jul 23, 2007
Messages
324
Reaction score
1
Location
Sweden
So in my login script i have a script whom removes all outfits you obtain in real tibia by quests, and adds a storage value to all player whom got all outfits deleted. This is nessecary in Tfs because all players start with all outfits.

This is the script i use

(It has some other stuff in it as well.) This script works fine and removes the correct outfits

Code:
function onLogin(cid)
 registerCreatureEvent(cid, "PlayerDeath")
 
 local minute = 10 -- interval in minutes
local minutes = minute * 60 * 1000 -- dont edit
 

if isPlayer(cid) then  
        queststatus = getPlayerStorageValue(cid, 25019)
        
     if queststatus == -1 then

 if getPlayerSex(cid)==0 then
 doPlayerRemOutfit(cid,146,0)
 doPlayerRemOutfit(cid,151,0)
 doPlayerRemOutfit(cid,152,0)
 doPlayerRemOutfit(cid,153,0)
 doPlayerRemOutfit(cid,154,0)
 doPlayerRemOutfit(cid,251,0)
 doPlayerRemOutfit(cid,268,0)
 doPlayerRemOutfit(cid,273,0)
 doPlayerRemOutfit(cid,278,0)
                 setPlayerStorageValue(cid,25019,1)
 
 elseif getPlayerSex(cid)==1 then
 

 doPlayerRemOutfit(cid,150,0)
 doPlayerRemOutfit(cid,155,0)
 doPlayerRemOutfit(cid,156,0)
 doPlayerRemOutfit(cid,157,0)
 doPlayerRemOutfit(cid,158,0)
 doPlayerRemOutfit(cid,252,0)
 doPlayerRemOutfit(cid,269,0)
 doPlayerRemOutfit(cid,270,0)
 doPlayerRemOutfit(cid,279,0)
                setPlayerStorageValue(cid,25019,1)
 
  else
        doPlayerSendTextMessage(cid,22,"Just a temporary already removed outfits message.")
     end
    end
end
 
 if(alryInitServSave == 0) then
  local eventServ = addEvent(autoSavePlayers, minutes, {})
  alryInitServSave = eventServ
 end
 return 1
end

function autoSavePlayers(parameters)
 saveData()
 print("Server save...")
 local eventServ = addEvent(autoSavePlayers, minutes, parameters)
 alryInitServSave = eventServ
end
Now i tried to add a quest which gives you an outfit depending on your characters sex.

Code:
function onUse(cid, item, frompos, item2, topos)

       if item.uid == 25020 then
           queststatus = getPlayerStorageValue(cid,25020)
           if queststatus == -1 then
        
            if getPlayerSex(cid)==0 then
               doPlayerSendTextMessage(cid,22,"you recieved the female outfit")
            doPlayerAddOutfit(cid,150,0)
               setPlayerStorageValue(cid,25020,1)
            
            elseif
            getPlayerSex(cid)==1 then
            doPlayerSendTextMessage(cid,22,"you recieved the male outfit")
            doPlayerAddOutfit(cid,146,0)
               setPlayerStorageValue(cid,25020,1)
            
           else
               doPlayerSendTextMessage(cid,22,"It is empty.")
           end
    end
end
end
It starts without errors but no outfit is added. You recieve the correct message depending on your sex but the chest is opened as a container and the second time you open it the text "It is empty." won't appear... And no outfit is added to the character!

If anyone know what i might do wrong or has the will / time to correct me then i really appreciate it.

Thanks in advance!

//Massen
 
maybe try it with like

Code:
doPlayerAddOutfit(cid,146,1)
doPlayerRemOutfit(cid,146,1)

it's supposed to add you the outfit with addon 1 and the 2nd thing will remove the 1st addon it could possible work just try it :)

kind regards, Evil Hero
 
function onUse(cid, item, frompos, item2, topos)

if item.uid == 25020 then
queststatus = getPlayerStorageValue(cid,25020)
if queststatus == -1 then

if getPlayerSex(cid)==0 then
doPlayerSendTextMessage(cid,22,"you recieved the female outfit")
doPlayerAddOutfit(cid,150,0)
setPlayerStorageValue(cid,25020,1)

elseif
getPlayerSex(cid)==1 then
doPlayerSendTextMessage(cid,22,"you recieved the male outfit")
doPlayerAddOutfit(cid,146,0)
setPlayerStorageValue(cid,25020,1)
end
else
doPlayerSendTextMessage(cid,22,"It is empty.")

end
end
end


you put an end on wrong place
 
function onUse(cid, item, frompos, item2, topos)

if item.uid == 25020 then
queststatus = getPlayerStorageValue(cid,25020)
if queststatus == -1 then

if getPlayerSex(cid)==0 then
doPlayerSendTextMessage(cid,22,"you recieved the female outfit")
doPlayerAddOutfit(cid,150,0)
setPlayerStorageValue(cid,25020,1)

elseif
getPlayerSex(cid)==1 then
doPlayerSendTextMessage(cid,22,"you recieved the male outfit")
doPlayerAddOutfit(cid,146,0)
setPlayerStorageValue(cid,25020,1)
end
else
doPlayerSendTextMessage(cid,22,"It is empty.")

end
end
end


you put an end on wrong place

Nope you're wrong his ends where fine

This is his code (tabbed it)

Code:
function onUse(cid, item, frompos, item2, topos)

	if item.uid == 25020 then
	queststatus = getPlayerStorageValue(cid,25020)
		if queststatus == -1 then
			if getPlayerSex(cid)==0 then
				doPlayerSendTextMessage(cid,22,"you recieved the female outfit")
				doPlayerAddOutfit(cid,150,0)
				setPlayerStorageValue(cid,25020,1)
			elseif getPlayerSex(cid)==1 then
				doPlayerSendTextMessage(cid,22,"you recieved the male outfit")
				doPlayerAddOutfit(cid,146,0)
				setPlayerStorageValue(cid,25020,1)
			else
				doPlayerSendTextMessage(cid,22,"It is empty.")
			end
		end
	end
end

Like you can see the ends are fine.

kind regards, Evil Hero
 
So noone have a clue what i might be doing wrong?

maybe try it with like

Code:
doPlayerAddOutfit(cid,146,1)
doPlayerRemOutfit(cid,146,1)

it's supposed to add you the outfit with addon 1 and the 2nd thing will remove the 1st addon it could possible work just try it :)

kind regards, Evil Hero

I tried to add only

Code:
doPlayerAddOutfit(cid,146,1)

and it didn't give the outfit so adding a
Code:
doPlayerRemOutfit(cid,146,1)

after it wont work =/


//Massen
 
Nope you're wrong his ends where fine

This is his code (tabbed it)

Code:
function onUse(cid, item, frompos, item2, topos)

	if item.uid == 25020 then
	queststatus = getPlayerStorageValue(cid,25020)
		if queststatus == -1 then
			if getPlayerSex(cid)==0 then
				doPlayerSendTextMessage(cid,22,"you recieved the female outfit")
				doPlayerAddOutfit(cid,150,0)
				setPlayerStorageValue(cid,25020,1)
			elseif getPlayerSex(cid)==1 then
				doPlayerSendTextMessage(cid,22,"you recieved the male outfit")
				doPlayerAddOutfit(cid,146,0)
				setPlayerStorageValue(cid,25020,1)
			else
				doPlayerSendTextMessage(cid,22,"It is empty.")
			end
		end
	end
end

Like you can see the ends are fine.

kind regards, Evil Hero

With his end it said "It's empty" when Sex is not 1 NOR 0 (2+, which is never is)

Code:
function onUse(cid, item, frompos, item2, topos)

	if item.uid == 25020 then
	queststatus = getPlayerStorageValue(cid,25020)
		if queststatus == -1 then
			if getPlayerSex(cid)==0 then
				doPlayerSendTextMessage(cid,22,"you recieved the female outfit")
				doPlayerAddOutfit(cid,150,0)
				setPlayerStorageValue(cid,25020,1)
			elseif getPlayerSex(cid)==1 then
				doPlayerSendTextMessage(cid,22,"you recieved the male outfit")
				doPlayerAddOutfit(cid,146,0)
				setPlayerStorageValue(cid,25020,1)
			end
		else
			doPlayerSendTextMessage(cid,22,"It is empty.")
		end
	end
end
that is my part tabbed
 
Last edited:
Rizz I didn't meant that your Script was wrong, I just meant that his endings where fine to ^_^

OnTopic: I'll try some things, if they work then I'll inform you :)

kind regards, Evil Hero
 
With his endings he didn't get the outcome he wanted.

Quoting his first post "You recieve the correct message depending on your sex but the chest is opened as a container and the second time you open it the text "It is empty." won't appear..."
 
So anyone know why no outfit is added upon opening the chest? i figured i had to place a return TRUE to make it work as a normal quest chest.

//Massen
 
Back
Top