- 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
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
Updated it use the update
What do u mean with "i need to put sone thing on the stone?"
Nothing Happen :O- 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
Than, in actions.xml:You should set stone actionid to 29001
And updated first post noticed a bug
- 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
<action actionid="29001" script="lstone.lua"/>
- 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
Warning: Event::LoadScript Can not load script. data/actions/scripts/premmy.lua:12 'end' expected < to close'if' at line 7 near 'else'
-- 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
Now, i need just the msge when the player have no premium days, can someone help please?----------------------------- 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
----------------------------------------------------------------------
-- 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
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