• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua Need 2x Scripts

Bazi

Member
Joined
Oct 24, 2011
Messages
270
Reaction score
8
Location
Germany
Hey i need 2x Scripts.

1. I need Script that i can Buy items whit a switch for Scarab Coins.

1. I need Script for Get 1 Monster Addon if use switch its reward i monster addon

Thank you :D
 
i have testet your addons already but i am very bad to check it :P i have test whit a monster addon and i dont get it if i use the switch :D
 
If you don't understand the posting script.. the addon say me and i edir the outfit of the monster you want and you edited it..

here you go your buyxclick :p
try - not tested*
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
		if getPlayerItemCount(cid, 2159) >= 50 then -- edit how scarabs 50? etc
			doPlayerRemoveItem(cid,2159,50) -- 50 how scarab remove in buy item
			doPlayerAddItem(cid,IDITEM)
                        doSendMagicEffect(getPlayerPosition(cid), 13)			
		else
			doPlayerSendTextMessage(cid,19,"You need ?? Scarab Coints for buy ??.")
			doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
		end
	return true
end
 
Last edited:
Thank you For That nice Script It works Fine .... now i test the addon script again :D

- - - Updated - - -

local outfitmale = 110
local outfitfemale = 110
local addons = 2
local storage = 1213

function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid, storage) == -1 then
doPlayerAddOutfit(cid, outfitmale, addons)
doPlayerAddOutfit(cid, outfitfemale, addons)
doPlayerSendTextMessage(cid, 21, "You get addons for assassin outfit!")
doSendMagicEffect(getCreaturePosition(cid), 28)
setPlayerStorageValue(cid, storage, 1)
else
doPlayerSendCancel(cid, "Already you have this addons.")
end
return true
end

i have test that.... but 1. if i have first and second addons there stand i got the addons already and 2. if i come whit player who no have first and second addons and use it there stand
21:56 You get addons for Snow Man outfit!

but i dont have :(
 
More easy here you go..
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid, storage) == -1 then
	doPlayerAddOutfit(cid, 150) -- edit Outfit id.. for your monster
	doPlayerSendTextMessage(cid, 21, "You get addon for NAME outfit!")
	doSendMagicEffect(getCreaturePosition(cid), 28)
	setPlayerStorageValue(cid, 1213, 1)
        else
	doPlayerSendCancel(cid, "Already you have this addons.")
          end
	return true
      end

You only need edit 150.. looktype for other you need.. example ,search in data/monsters..
and open archive .xml what monster need you see looktype "" and changed looktype for 150 ;)
 
Its why you don't added in outfits.xml
LUA:
<outfit id="25" premium="yes"> 
        <list gender="0-3" lookType="110" name="Name Outfit"/>
    </outfit>

and

LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid, storage) == -1 then
	doPlayerAddOutfit(cid, 110) -- edit Outfit id.. for your monster
	doPlayerSendTextMessage(cid, 21, "You get addon for NAME outfit!")
	doSendMagicEffect(getCreaturePosition(cid), 28)
	setPlayerStorageValue(cid, 1213, 1)
        else
	doPlayerSendCancel(cid, "Already you have this addons.")
          end
	return true
      end
 
ahhhh now thx :D

- - - Updated - - -

[10/08/2012 00:31:43] [Error - Action Interface]
[10/08/2012 00:31:43] data/actions/scripts/AddonsxQuest/10Reb.lua:onUse
[10/08/2012 00:31:43] Description:
[10/08/2012 00:31:43] (luaDoPlayerAddOutfit) Player not found
 
hmm..
now?
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid, storage) == -1 then
doPlayerAddOutfit(cid,110,3)
doPlayerSendTextMessage(cid, 21, "You get addon for NAME outfit!")
doSendMagicEffect(getCreaturePosition(cid), 28)
setPlayerStorageValue(cid, 1213, 1)
 else
doPlayerSendCancel(cid, "Already you have this addons.")
end
return true
end
 
Code:
 <outfit id="28" premium="yes">
<list gender="0" lookType="110" name="10 Reb Addon"/>
<list gender="1" lookType="110" name="10 Reb Addon"/>
</outfit>
for
Code:
<outfit id="28" premium="yes">
<list gender="0-3" lookType="110" name="10 Reb Addon"/>
</outfit>
 
i have test
outfit id="28" premium="yes">
<list gender="0-3" lookType="110" name="10 Reb Addon"/>
</outfit>
al ready it dont works

- - - Updated - - -

:P xd
 
Strange, ami i it works.. trying in this then:

LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid, storage) == -1 then
doCreatureChangeOutfit(cid, 110)
doPlayerSendTextMessage(cid, 21, "You get addon for NAME outfit!")
doSendMagicEffect(getCreaturePosition(cid), 28)
setPlayerStorageValue(cid, 1213, 1)
 else
doPlayerSendCancel(cid, "Already you have this addons.")
end
return true
end

and

Code:
<outfit id="28" premium="yes">
<list gender="0-3" lookType="110" name="10 Reb Addon"/> <!-- storageId="1213" storageValue="1"-->
</outfit>
 
[10/08/2012 01:02:53] [Error - Action Interface]
[10/08/2012 01:02:53] data/actions/scripts/AddonsxQuest/10Reb.lua:onUse
[10/08/2012 01:02:53] Description:
[10/08/2012 01:02:53] attempt to index a number value
[10/08/2012 01:02:53] stack traceback:
[10/08/2012 01:02:53] [C]: in function 'doCreatureChangeOutfit'
[10/08/2012 01:02:53] data/actions/scripts/AddonsxQuest/10Reb.lua:3: in function <data/actions/scripts/AddonsxQuest/10Reb.lua:1>
 
I think that you might look at my error is by the addoutfit in 3 try now..
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if (getPlayerStorageValue(cid, 1213) == EMPTY_STORAGE) then
setPlayerStorageValue(cid, 1213, 1)
doPlayerAddOutfit(cid,110, 0)
doPlayerSendTextMessage(cid, 21, "You get addon for NAME outfit!")
doSendMagicEffect(getCreaturePosition(cid), 28)
else
doPlayerSendCancel(cid, "Already you have this addons.")
end
return true
end
 
Data/actions/scripts/AddonsxQuest/10Reb.lua


function onUse(cid, item, fromPosition, itemEx, toPosition)
if (getPlayerStorageValue(cid, 1213) == EMPTY_STORAGE) then
setPlayerStorageValue(cid, 1213, 1)
doPlayerAddOutfit(cid,110, 0)
doPlayerSendTextMessage(cid, 21, "You get addon for NAME outfit!")
doSendMagicEffect(getCreaturePosition(cid), 28)
else
doPlayerSendCancel(cid, "Already you have this addons.")
end
return true
end

Data/actions/actions.xml
<action actionid="4581" script="AddonsxQuest/10Reb.lua"/>


Data/Xml/outfits.xml

<outfit id="29" premium="yes">
<list gender="0-3" lookType="110" name="10 Reb Addon"/> <!-- storageId="1213" storageValue="1"-->
</outfit>


01:12 You get addon for 10 Reb outfit!

but i dont get the outfit ...
 
lol.. Me works 100%.
doubt, you need give premium account in
config.lua
freepremium ="no"
for yes..
or buy premium talkaction !buypremium
you have premium in your account??
 
Back
Top