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

Lua How to insert/use properly this .lua code!?!?

andrew95434

Banned User
Joined
May 6, 2010
Messages
86
Reaction score
0
Location
chile
What this does is that you finish a cave or part of the quest(Inquisition), and it saves it, then if you die and you finished for ex: crystal caves, you can enter to the tp in here:
inkitproom.png

instead of doing it all over again


I have this .lua code, but i dont know how to use it or where to put the uid's:


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

        if item.uid == 4073 then
                queststatus = getPlayerStorageValue(cid,4072)
                if queststatus == -1 then
                        doPlayerSendTextMessage(cid,22,"You have saved the Crystal Caves.")
                        setPlayerStorageValue(cid,4072,1)
                else
                        doPlayerSendTextMessage(cid,22,"This seal was saved.")
                end
        elseif item.uid == 4075 then
                queststatus = getPlayerStorageValue(cid,4074)
                if queststatus == -1 then
                        doPlayerSendTextMessage(cid,22,"You have saved the Blood Hall.")
                        setPlayerStorageValue(cid,4074,1)
                else
                        doPlayerSendTextMessage(cid,22,"This seal was saved.")
                end
        elseif item.uid == 4077 then
                queststatus = getPlayerStorageValue(cid,4076)
                if queststatus == -1 then
                        doPlayerSendTextMessage(cid,22,"You have saved the Vats.")
                        setPlayerStorageValue(cid,4076,1)
                else
                        doPlayerSendTextMessage(cid,22,"This seal was saved.")
                end
        elseif item.uid == 4079 then
                queststatus = getPlayerStorageValue(cid,4078)
                if queststatus == -1 then
                        doPlayerSendTextMessage(cid,22,"You have saved the Arcanum.")
                        setPlayerStorageValue(cid,4078,1)
                else
                        doPlayerSendTextMessage(cid,22,"This seal was saved.")
                end
        elseif item.uid == 4081 then
                queststatus = getPlayerStorageValue(cid,4080)
                if queststatus == -1 then
                        doPlayerSendTextMessage(cid,22,"You have saved the Hive.")
                        setPlayerStorageValue(cid,4080,1)
                else
                        doPlayerSendTextMessage(cid,22,"This seal was saved.")
                
                end
        else
                return 0
        end

        return 1
end

and in actions.xml i have this:

Code:
	<!-- Inquisiton Quest -->
      	  <action uniqueid="4073" script="Inquisition/inquisition_seal.lua" />
       	  <action uniqueid="4075" script="Inquisition/inquisition_seal.lua" />
   	 <action uniqueid="4077" script="Inquisition/inquisition_seal.lua" />
    	 <action uniqueid="4079" script="Inquisition/inquisition_seal.lua" />
        	 <action uniqueid="4081" script="Inquisition/inquisition_seal.lua" />

Please help, do i need to insert the UID on a chest?, or in the floor, or the tp when you kill the boss? plz help

i would appreciate very much if you could help me solve this doubt thx!!!
 
lets do some simple problem solving shall we?

function onUse
if item.uid == 4073
setPlayerStorageValue(cid,4072,1)

Now, what do you think that means?
 
Yeah sometimes all you need to do is read the script, most of the time problems like this can be easily solved :p

onUse - the script will work when the specific item has been used.
item.uid means the item needs to have the corresponding unique id to the script.

Long story short, put a couple statues at the end of each seal, right click them in the map editor and set a unique id for them which needs to be the same as the ones on the script. The seals will only be saved when the statue or whatever has been used so in my opinion you would probably be better off getting a tp script which gives you a storage value once you've went through.

Just to let you know that script you posted there wont allow you to enter the tp's once the seal has been saved, it only gives the character a storage value so the seal has been saved. Going on the screenshot you need a different script to enter the tp's once the seals are saved.
 
lets do some simple problem solving shall we?

function onUse
if item.uid == 4073
setPlayerStorageValue(cid,4072,1)

Now, what do you think that means?

i actually tried putting the uid to an item and i tried right-clicking it and nothing worked, that why I asked for some help...
 
Yeah sometimes all you need to do is read the script, most of the time problems like this can be easily solved :p

onUse - the script will work when the specific item has been used.
item.uid means the item needs to have the corresponding unique id to the script.

Long story short, put a couple statues at the end of each seal, right click them in the map editor and set a unique id for them which needs to be the same as the ones on the script. The seals will only be saved when the statue or whatever has been used so in my opinion you would probably be better off getting a tp script which gives you a storage value once you've went through.

Just to let you know that script you posted there wont allow you to enter the tp's once the seal has been saved, it only gives the character a storage value so the seal has been saved. Going on the screenshot you need a different script to enter the tp's once the seals are saved.

thank you for the explanation but it didnt work :/, im going to leave it blank, but if you could do or help or suggest some idea of the script it would be nice, thank you and you deserve some repp
 
function onuse
if item.uid == 4073
setPlayerStorageValue(cid,4072,1)

make a door to the teleport open if player has storage 4072 only.
 
Back
Top