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

[REQUST] Phrase on Position Gives Addon

BlackList

PassingWrath.us
Joined
Aug 30, 2007
Messages
133
Reaction score
26
Basically, you are standing on a certain position. You say a certain phrase like "over turn" and returns back with an outfit or addon.

Here is a script that is somewhat like that, but does blessings, but also, it doesn't work. I fails to check if player is on location.
Lua:
local player = {x = 1247, y = 1054, z = 7, stackpos = 3}

function onSay(cid, words, param, fromPosition, toPosition)
         if getPlayerBlessing(cid, 1) or getPlayerBlessing(cid, 2) or getPlayerBlessing(cid, 3) or getPlayerBlessing(cid, 4) or getPlayerBlessing(cid, 5) then
              doPlayerSendCancel(cid,'You have already got one or more blessings!')
         else
                 if getCreaturePosition(cid, player) == true then
                    doPlayerAddBlessing(cid, 1)
                    doPlayerAddBlessing(cid, 2)
                    doPlayerAddBlessing(cid, 3)
                    doPlayerAddBlessing(cid, 4)
                    doPlayerAddBlessing(cid, 5)
                    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
                    doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have been blessed by the gods!')
                 else
                    doPlayerSendCancel(cid, "You must be located in front of the Hand of Faith!")
                 end
         end
    return 1
end

I know this exists somewhere, I just can't find it :( So if you can possibly make one or if you know the location, sharing it would be great, thank you!
 
Here is your blessing script:
Lua:
local player = {x = 1247, y = 1054, z = 7, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE}
 
function onSay(cid, words, param, fromPosition, toPosition)
         if getPlayerBlessing(cid, 1) or getPlayerBlessing(cid, 2) or getPlayerBlessing(cid, 3) or getPlayerBlessing(cid, 4) or getPlayerBlessing(cid, 5) then
              doPlayerSendCancel(cid,'You have already got one or more blessings!')
         else
			 if getCreaturePosition(cid) == player then
				doPlayerAddBlessing(cid, 1)
				doPlayerAddBlessing(cid, 2)
				doPlayerAddBlessing(cid, 3)
				doPlayerAddBlessing(cid, 4)
				doPlayerAddBlessing(cid, 5)
				doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
				doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have been blessed by the gods!')
			 else
				doPlayerSendCancel(cid, "You must be located in front of the Hand of Faith!")
			 end
         end
    return 1
end

And here is your addon script:
Lua:
local player = {x = 1247, y = 1054, z = 7, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE}
local config = 
{
	storage = xxxxx, -- Storage for the Addon, if it's picked up or not
	looktype = {136,128}, -- Male and Female looktype of the outfit (citizen in this case)
	addons = {1} -- The addons you get (write {1,2} and you get both addons
}
function onSay(cid, words, param, fromPosition, toPosition)
         if getPlayerStorageValue(cid, config.storage) ~= -1 then
              doPlayerSendCancel(cid,'You already got this addon!')
         else
			 if getCreaturePosition(cid) == player then
				for i = 1, #config.addons do
					doPlayerAddOutfit(cid,config.looktype[1],config.addons[i])
					doPlayerAddOutfit(cid,config.looktype[2],config.addons[i])
				end
				setPlayerStorageValue(cid, config.storage, 1)
			 else
				doPlayerSendCancel(cid, "You must be located in front of the Hand of Faith!")
			 end
         end
    return 1
end
I hope it works in the way you want it to.
I can also make it a little more global, so you can say: blabla "hunter and then get addons for hunter, etc.
You tell me if you like it :)
 
Thank you very much! Thank you thank you! Enjoy the reputation! :)

- - - Updated - - -

Sorry double post, but the bless script does seem to be working :/ Position is correct, but when I'm on the spot, it only says must be standing in front blag blah. I tried fixing it but no luck :/

- - - Updated - - -

Same with the outfit quest. Just spits because say not in right location.
 
Last edited:
Try this, change this line in both scripts
Lua:
if getCreaturePosition(cid) == player then
into
Lua:
if getThingfromPos(player).uid == cid then
 
Back
Top