Matt
Banned
- Joined
- May 9, 2013
- Messages
- 595
- Reaction score
- 45
Cze??.
Postanowi?em zn?w umie?ci? tutaj jeden z moich unikalnych skrypt?w, kt?ry pisa?em jaki? czas temu i nie jest mi on zbytnio potrzebny do ?ycia.
Autor: Oczywi?cie, ?e ja.
Opis: Dzia?anie skryptu jest praktycznie takie samo jak na filmiku Oskara.
Skrypt:
Wejd? do data/actions/scripts i podmie? ca?? zawarto?? pick.lua na t?:
[LUA]-- Mining System by Matt
oreid = 7201 -- id rudy zelaza, zlota, srebra
toId = 7202 -- do jakiego id ma sie zamienic dana ruda
giveItem = 7203 -- id stopu rudy, kt?ry otrzymuje gracz
storage = 152535 -- storage do exhuasta
text = {
[1] = {word="BAM", color=TEXTCOLOR_GREY},
[2] = {word="PUFF", color=TEXTCOLOR_GREY},
[3] = {word="POF BAM", color=TEXTCOLOR_GREY},
[4] = {word="PUK POF", color=TEXTCOLOR_GREY},
[5] = {word="PUFF BAM", color=TEXTCOLOR_GREY}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local itemGround = getThingFromPos({x = toPosition.x, y = toPosition.y, z = toPosition.z + 1, stackpos = STACKPOS_GROUND})
if(isInArray(SPOTS, itemGround.itemid) and isInArray({354, 355}, itemEx.itemid)) then
doTransformItem(itemEx.uid, 392)
doDecayItem(itemEx.uid)
doSendMagicEffect(toPosition, CONST_ME_POFF)
return true
end
if(itemEx.itemid == 7200) then
doTransformItem(itemEx.uid, 7236)
doSendMagicEffect(toPosition, CONST_ME_BLOCKHIT)
return true
end
if(itemEx.itemid == oreid) then
local getStorage, skill, rand = getPlayerStorageValue(cid, itemEx.uid), getPlayerSkill(cid, SKILL_CLUB), 0
if(skill >= 10 and skill < 50) then
rand = math.random(6, 15)
elseif(skill >= 50 and skill < 100) then
rand = math.random(6, 10)
elseif(skill >= 100 and skill < 150) then
rand = math.random(4, 8)
else
rand = math.random(2, 5)
end
if(getStorage > rand) then
doTransformItem(itemEx.uid, toId)
doPlayerAddItem(cid, giveItem, 1)
setPlayerStorageValue(cid, itemEx.uid, 0)
else
local talk, txt = math.random(1,5), text[talk]
if (not txt) then
return false
end
if exhaustion.get(cid, storage) then
seconds = math.floor(((exhaustion.get(cid, storage)) + 1))
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have to wait "..seconds.." seconds to use pick again.")
return false
end
exhaustion.set(cid, storage, 5)
setPlayerStorageValue(cid, itemEx.uid, getStorage + 1)
doSendMagicEffect(toPosition, CONST_ME_POFF)
doSendAnimatedText(toPosition, txt.word, txt.color)
return true
end
end
end[/LUA]
Pami?tajcie, aby ustawi? sobie dobrze wszystkie ID i og?lnie bo inaczej nie b?dzie dzia?a?.
Je?li pojawi? si? jakie? b??dy to prosz? pisa? bo nie pami?tam do ko?ca czy skrypt dzia?a? poprawnie.
Pozdrawiam,
Matt.
Postanowi?em zn?w umie?ci? tutaj jeden z moich unikalnych skrypt?w, kt?ry pisa?em jaki? czas temu i nie jest mi on zbytnio potrzebny do ?ycia.
Autor: Oczywi?cie, ?e ja.
Opis: Dzia?anie skryptu jest praktycznie takie samo jak na filmiku Oskara.
Wejd? do data/actions/scripts i podmie? ca?? zawarto?? pick.lua na t?:
[LUA]-- Mining System by Matt
oreid = 7201 -- id rudy zelaza, zlota, srebra
toId = 7202 -- do jakiego id ma sie zamienic dana ruda
giveItem = 7203 -- id stopu rudy, kt?ry otrzymuje gracz
storage = 152535 -- storage do exhuasta
text = {
[1] = {word="BAM", color=TEXTCOLOR_GREY},
[2] = {word="PUFF", color=TEXTCOLOR_GREY},
[3] = {word="POF BAM", color=TEXTCOLOR_GREY},
[4] = {word="PUK POF", color=TEXTCOLOR_GREY},
[5] = {word="PUFF BAM", color=TEXTCOLOR_GREY}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local itemGround = getThingFromPos({x = toPosition.x, y = toPosition.y, z = toPosition.z + 1, stackpos = STACKPOS_GROUND})
if(isInArray(SPOTS, itemGround.itemid) and isInArray({354, 355}, itemEx.itemid)) then
doTransformItem(itemEx.uid, 392)
doDecayItem(itemEx.uid)
doSendMagicEffect(toPosition, CONST_ME_POFF)
return true
end
if(itemEx.itemid == 7200) then
doTransformItem(itemEx.uid, 7236)
doSendMagicEffect(toPosition, CONST_ME_BLOCKHIT)
return true
end
if(itemEx.itemid == oreid) then
local getStorage, skill, rand = getPlayerStorageValue(cid, itemEx.uid), getPlayerSkill(cid, SKILL_CLUB), 0
if(skill >= 10 and skill < 50) then
rand = math.random(6, 15)
elseif(skill >= 50 and skill < 100) then
rand = math.random(6, 10)
elseif(skill >= 100 and skill < 150) then
rand = math.random(4, 8)
else
rand = math.random(2, 5)
end
if(getStorage > rand) then
doTransformItem(itemEx.uid, toId)
doPlayerAddItem(cid, giveItem, 1)
setPlayerStorageValue(cid, itemEx.uid, 0)
else
local talk, txt = math.random(1,5), text[talk]
if (not txt) then
return false
end
if exhaustion.get(cid, storage) then
seconds = math.floor(((exhaustion.get(cid, storage)) + 1))
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have to wait "..seconds.." seconds to use pick again.")
return false
end
exhaustion.set(cid, storage, 5)
setPlayerStorageValue(cid, itemEx.uid, getStorage + 1)
doSendMagicEffect(toPosition, CONST_ME_POFF)
doSendAnimatedText(toPosition, txt.word, txt.color)
return true
end
end
end[/LUA]
Pami?tajcie, aby ustawi? sobie dobrze wszystkie ID i og?lnie bo inaczej nie b?dzie dzia?a?.
Je?li pojawi? si? jakie? b??dy to prosz? pisa? bo nie pami?tam do ko?ca czy skrypt dzia?a? poprawnie.
Pozdrawiam,
Matt.