What's new

Skrypty & Kody 8.1 poty

Status
Not open for further replies.

RemoMKWA

Advanced User
Joined
Mar 2, 2010
Messages
209
Reaction score
4
Witam mam scrypt na health potion ale jak go u?yje to pisze you are exhausted i tak ca?u czas :/
Code:
function onUse(cid, item, frompos, item2, topos)

playerpos = {x=topos.x, y=topos.y, z=topos.z, stackpos=253}
player = getThingfromPos(playerpos)
ml = getPlayerMagLevel(cid)
lvl = getPlayerLevel(cid)
voc = getPlayerVocation(cid)
ex = getPlayerStorageValue(cid,4862)
r1 = math.random(100,300)

params = { [1]=cid, [2]=lvl, [3]=voc, [4]=ml }

if item2.itemid == 1 then
if item.itemid == 7636 then
doPlayerSendCancel(cid,"It is empty.")
else
if item2.uid == cid then
if ex == -1 then
doPlayerAddHealth(cid,r1)
doSendMagicEffect(playerpos,12)
addEvent(ums,1000,params)
setPlayerStorageValue(cid,4862, 1)
doTransformItem(item.uid,7636)
doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
else
doPlayerSendCancel(cid,'You are exhausted!')
doSendMagicEffect(playerpos,2)
end
else
splash = doCreateItem(1903,item.type,topos)
doTransformItem(item.uid,7636)
doDecayItem(splash)
end
end
else
if item.itemid == 7636 then
doPlayerSendCancel(cid,"It is empty.")
else
splash = doCreateItem(1903,item.type,topos)
doTransformItem(item.uid,7636)
doDecayItem(splash)
end
end
return 1
end

function ums(params)
cid = params[1]
setPlayerStorageValue(cid,4862, -1)
end
 

Quomak

Senior User
Joined
Jul 15, 2010
Messages
631
Reaction score
40
Age
10
Odp: 8.1 poty

Code:
local MIN = [COLOR="Green"]100[/COLOR]
local MAX = [COLOR="Blue"]200[/COLOR]
local EMPTY_POTION = 7636

local exhaust = createConditionObject(CONDITION_EXHAUSTED)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, getConfigInfo('timeBetweenActions'))

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isPlayer(itemEx.uid) == FALSE then
		return FALSE
	end

	if hasCondition(cid, CONDITION_EXHAUSTED) == TRUE then
		doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
		return TRUE
	end

	if doCreatureAddHealth(itemEx.uid, math.random(MIN, MAX)) == LUA_ERROR then
		return FALSE
	end

	doAddCondition(cid, exhaust)
	doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
	doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1) 
	doTransformItem(item.uid, EMPTY_POTION)
	return TRUE
end

Napisz czy dziala
 

VumiToo

User
Joined
Nov 29, 2011
Messages
48
Reaction score
2
Odp: 8.1 poty

Code:
        hp_id = 7618 -- Item a ser vendido
        backpackhp_id = 2000 -- Backpack
		custohp_id = 900 -- Valor
		cargashp_id = 20 -- Cargas

local name = getItemNameById(hp_id)
----- End Config -----
function onUse(cid, item, fromPosition, itemEx, toPosition)
        if doPlayerRemoveMoney(cid, custohp_id) == TRUE then
                local bag = doPlayerAddItem(cid, backpackhp_id, 1)
                        doSendAnimatedText(fromPosition, "Purchased", TEXTCOLOR_YELLOW)
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have purchased a backpack of ".. name .."s for ".. custohp_id .." gold.")
						for i=1,20 do
                        doAddContainerItem(bag, hp_id, cargashp_id)
                end
                else
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You need ".. custohp_id .." gold coins for a backpack of ".. name .."s.")
                end
        return FALSE
end

Sprawd? i powiedz czy dzia?a
 

Tron

Active User
Joined
Sep 6, 2010
Messages
122
Reaction score
23
Odp: 8.1 poty

#VumiToo
co ma piernik do wiatraka?

Prosz? to m?j skrypt na pewno dzia?a
HTML:
function onUse(cid, item, frompos, item2, topos)
local mikstura = 7620
local pusty = 7636
local malo = 75
local duzo = 175
local min = malo
local max = duzo
local add = math.random(min, max)
local pos = getCreaturePosition(cid)
time = 2
local time_needed = getPlayerStorageValue(cid, 6000) + time
if(os.time() >= time_needed) then
setPlayerStorageValue(cid, 6000, os.time())
if(item.itemid == mikstura) then
doCreatureAddHealth(cid, add)
doSendAnimatedText(pos, '+'..add, 205)
doPlayerSendTextMessage(cid,24,"Mala mikstura zycia przywrocila " .. add .. " punktow zycia.")
doSendMagicEffect(pos, 30)
doTransformItem(item.uid, pusty)
end
else
doPlayerSendCancel(cid, "Nie mozesz pic tak szybko.")
end
return TRUE
end
 

RemoMKWA

Advanced User
Joined
Mar 2, 2010
Messages
209
Reaction score
4
Odp: 8.1 poty

b??du nie ma w consoli ale nie dzia?a nie da rady uzy? ;/
 
Status
Not open for further replies.
Top