• 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
 
Hmm try this
PHP:
- A script made by Clary 100% by a request from jpkulik
---------------------------- Start Config ----------------------------
local stonepos = {x=1000, y=1000, z=7, stackpos=1} -- Stone pos
local STONEID = 1414 -- stone id
----------------------------- End Config -----------------------------
function onUse(cid, item, fromPos, item2, toPos)
if item.actionid == 29001 and item.itemid == 1945 then
doRemoveItem(getThingfromPos(stonepos).uid)
doTransformItem(item.uid,1946)
else
doCreateItem(STONEID, 1, stonepos)
doTransformItem(item.uid, 1945)
end
return 1
end
 
Last edited:
Hmm try this
PHP:
- A script made by Clary 100% by a request from jpkulik
---------------------------- Start Config ----------------------------
local stonepospos = {x=1000, y=1000, z=7, stackpos=1} -- Stone pos
local STONEID = 1414 -- wall id
----------------------------- End Config -----------------------------
function onUse(cid, item, fromPos, item2, toPos)
if item.actionid == 29001 and item.itemid == 1945 then
doRemoveItem(getThingfromPos(stonepos).uid)
doTransformItem(item.uid,1946)
else
doCreateItem(STONEID, 1, wallpos)
doTransformItem(item.uid, 1945)
end
return 1
end

i will try it. I edit soon.

EDIT
<action id="29001" script="quests/dh.lua" /> This tag?
I did, on the lever ActionID 29001 in Mapeditor. COnfigure every thing
I have put the 29001 on the lever, and , i need to put sone thing on the stone? CYa
 
Last edited:
Updated it use the update ;)
What do u mean with "i need to put sone thing on the stone?"

I will try.
Aboult the stone, i want to know if a need to put some actionID, haha
or uniqueid, cya
Edit sooN.

Edit:
Code:
- A script made by Clary 100% by a request from jpkulik
---------------------------- Start Config ----------------------------
local stonepos = {x=1016, y=1290, z=13, stackpos=1} -- Stone pos
local STONEID = 1354 -- wall id
----------------------------- End Config -----------------------------
function onUse(cid, item, fromPos, item2, toPos)
if item.actionid == 29001 and item.itemid == 1945 then
doRemoveItem(getThingfromPos(stonepos).uid)
doTransformItem(item.uid,1946)
else
doCreateItem(STONEID, 1, stonepos)
doTransformItem(item.uid, 1945)
end
return 1
end
Nothing Happen :O
I dont get any error in the console, nidder, no stone is removed :O
Cya
 
Last edited:
You should set stone actionid to 29001
And updated first post noticed a bug ;)
Than, in actions.xml:
<action id="29001" script="quests/dh.lua" />
<action id="29001" script="quests/dh.lua" />
and the lever: action id 29001
And the stone 29001?
 
see this should make u understand :/
open actions/scripts copy paste any .lua and .lua file and name it to lstone
and paste this in it:
PHP:
- A script made by Clary 100% by a request from jpkulik
---------------------------- Start Config ----------------------------
local stonepos = {x=1016, y=1290, z=13, stackpos=1} -- Stone pos
local STONEID = 1354 -- stone id
----------------------------- End Config -----------------------------
function onUse(cid, item, fromPos, item2, toPos)
if item.actionid == 29001 and item.itemid == 1945 then
doRemoveItem(getThingfromPos(stonepos).uid)
doTransformItem(item.uid,1946)
else
doCreateItem(STONEID, 1, stonepos)
doTransformItem(item.uid, 1945)
end
return 1
end
and this in actions.xml
Code:
	<action actionid="29001" script="lstone.lua"/>
and in map make the lever action id 29001 stone just place it :/
 
Hey Clary!
Tansk fella.. There is no bug, the bug has mine:
I has putting
<action id="29001" script="lstone.lua"/>
Ii shoud be
<action actionid="29001" script="lstone.lua"/>
:D
Tankyou fella!
Now, if you can, can you helpme with another one?

Im needing a last script for finish every thing.
The script is:
When the player press the lever, get a iten, and loose "xpremmydays"
It is like a premium shop, who trade the iten, for premium days.
Cya
and tankyou!
 
Sure :) here you go
PHP:
- A script made by Clary 100% by a request from jpkulik
---------------------------- Start Config ----------------------------
local COUNT = 1 -- How many items you get.
local ITEMID = 1354 -- Item sold id.
local PDAYS = 5 -- 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)
doTransformItem(item.uid,1946)
else
doPlayerSendTextMessage(cid,22,'You must have '..PDAYS..' at least to buy this item.')
else
doTransformItem(item.uid, 1945)
end
return 1
end
end
 
I will take a shower, and back in 1 hour.
Can you post the tags?
Becouse as you see, im not good with this, haha
Cya fella
(a good scripter)
:p
Cya
 
here u go
PHP:
-- A script made by Clary 100% by a request from jpkulik
---------------------------- Start Config ----------------------------
local COUNT = 1 -- How many items you get.
local ITEMID = 1354 -- Item sold id.
local PDAYS = 5 -- 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)
doTransformItem(item.uid,1946)
else
doTransformItem(item.uid, 1945)
end
end
 
Last edited:
Hey! Great script, i finish it, look
----------------------------- End Config -----------------------------
-- A script made by Clary 100% 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 and getPlayerPremiumDays(cid) >= PDAYS then
doPlayerAddItem(cid, ITEMID, COUNT)
doPlayerRemovePremiumDays(cid, PDAYS)
doPlayerSendTextMessage(cid, 22, "You have buy 30k for 3 premium account days.")
doTransformItem(item.uid,1946)
else
doTransformItem(item.uid, 1945)
end
end
Now, i need just the msge when the player have no premium days, can someone help please?
 
its b/c he did add it to the script he only made it check if u have X amount of days i dont think there is a function to remove the amount of premmy days a player has left

edit: nvm i guess there is you got to post b4 me. is this what you want

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.")
			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

the red is what i changed at the top i got rid of the 'and' in the if statement and made it into to separate if statements
 
Last edited:
its b/c he did add it to the script he only made it check if u have X amount of days i dont think there is a function to remove the amount of premmy days a player has left

edit: nvm i guess there is you got to post b4 me. is this what you want

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.")
			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

the red is what i changed at the top i got rid of the 'and' in the if statement and made it into to separate if statements

Great
Exacly what i was needing!
Tanks to yuo both.
Now, just to finish it, can you add a effect when the iten is buyed? :D
Ciao fellas!
 
Back
Top