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

Demon Helmet Stone(request)

jpkulik

New Member
Joined
Mar 15, 2008
Messages
208
Reaction score
2
Hello..
Im nedding a script, that, when the player use a lever, remove a stone, and when press it again, put the stone in the tile.
(the stone of Demon helmet quest)
O hope someone can helpme fellas.
Cya:D
 
this? i added that read line change the blue number with a constant value from the global file. this should work but i'm not sure. the constant value should look something like HEALLINGSPARKLE or SDHIT or POFF
Code:
----------------------------------------------------------------------
-- A script made by Clary [COLOR="Red"]80[/COLOR]% by a request from jpkulik
---------------------------- Start Config ----------------------------
local COUNT = 3 -- How many items you get.
local ITEMID = 2160 -- Item sold id.
local PDAYS = 1 -- The premium days lost on use.
----------------------------- End Config -----------------------------
function onUse(cid, item, fromPos, item2, toPos)
	if item.actionid == 29002 and item.itemid == 1945 [COLOR="Red"]then[/COLOR]
		[COLOR="Red"]if[/COLOR] getPlayerPremiumDays(cid) >= PDAYS then
			doPlayerAddItem(cid, ITEMID, COUNT)
			doPlayerRemovePremiumDays(cid, PDAYS)
			doPlayerSendTextMessage(cid, 22, "You have buy 30k for 3 premium account days.")
			[COLOR="Red"]doSendMagicEffect(getPlayerPosition(cid), [COLOR="Blue"]55[/COLOR])[/COLOR]
			doTransformItem(item.uid,1946)
		[COLOR="Red"]else
			doPlayerSendTextMessage(cid, 22, "You dont have enough premium days left.")
		end[/COLOR]
	else
		doTransformItem(item.uid, 1945)
	end
end
 
Soul notice that I used and it isn't needed to use if in more than 1 line :/ just use and so, ur add for if and then is useless :p
the red is ur change.
PHP:
----------------------------------------------------------------------
-- A script made by Clary 100%
---------------------------- Start Config ----------------------------
local COUNT = 3 -- How many items you get.
local ITEMID = 2160 -- Item sold id.
local PDAYS = 1 -- The premium days lost on use.
----------------------------- End Config -----------------------------
function onUse(cid, item, fromPos, item2, toPos)
	if item.actionid == 29002 and item.itemid == 1945 and getPlayerPremiumDays(cid) >= PDAYS then
			doPlayerAddItem(cid, ITEMID, COUNT)
			doPlayerRemovePremiumDays(cid, PDAYS)
			doSendMagicEffect(getPlayerPosition(cid), 55)			doPlayerSendTextMessage(cid, 22, "You have buy 30k for 3 premium account days.")
			doTransformItem(item.uid,1946)
		else
			doPlayerSendTextMessage(cid, 22, "You dont have enough premium days left.")
                        doSendMagicEffect(getPlayerPosition(cid),POFF)
		end
	else
		doTransformItem(item.uid, 1945)
	end
end
lines added by soul
cancel msg
Code:
		else
			doPlayerSendTextMessage(cid, 22, "You dont have enough premium days left.")
magic effect
Code:
doSendMagicEffect(getPlayerPosition(cid), 55)
rest added by me.
New in this script.
I added a cancel magic effect but not sure if poff is the right term I am not at my home now :/ So, I can't check global.lua
soul4soul said:
the red is what i changed at the top i got rid of the 'and' in the if statement
as I said in the top of my post ur just making the scriptt longer.

Don't remove my credits please...
 
Last edited:
:eek: kk. I didnt know u where able to use to 2 else statements for the 1 if statement, the scripts did the same thing just ur is sightly more efficient
 
Back
Top