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

[8.54][TFS 0.3.6pl1]Poprawa skryptu.

margoh

{{ user.title }}
Joined
Apr 1, 2013
Messages
806
Solutions
18
Reaction score
350
Witam,
Czy znalazłby się ktoś tak miły i poprawił mi ten skrypt:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
ITEM = 2673
local storage = 50000
local wait = 0.7
		if fromPosition.x ~= CONTAINER_POSITION and exhaustion.get(cid, storage) == FALSE then
			REG_HEALTH = getCreatureMaxHealth(cid)
			REG_MANA = getPlayerMaxMana(cid)
				doPlayerAddMana(cid, REG_MANA)
				doCreatureAddHealth(cid, REG_HEALTH)
					doRemoveItem(item.uid, 1)
				exhaustion.set(cid, storage, wait)
			elseif item.itemid == ITEM and exhaustion.get(cid, storage) == FALSE then
				REG_HEALTH = getCreatureMaxHealth(cid)
				REG_MANA = getPlayerMaxMana(cid)
					doPlayerAddMana(cid, REG_MANA)
					doCreatureAddHealth(cid, REG_HEALTH)
						doRemoveItem(item.uid,1)
					exhaustion.set(cid, storage, wait)
		else
			doPlayerSendCancel(cid, "You are exhausted.")
		end
	return TRUE
end

Chciałbym by nie regenerował całego hp i many, tylko działało to na zasadzie im większy lvl tym więce.

Drugi skrypt który chciałbym by ktoś poprawił to ten:
Code:
function onCastSpell(cid, var)
	if isPlayer(cid) == TRUE and
		getCreatureCondition(cid, CONDITION_INFIGHT) == false and
			exhaustion.get(cid,61266) == false then
			local maxHP = getCreatureMaxHealth(cid)
			local maxMANA = getPlayerMaxMana(cid)
				doPlayerAddMana(cid, maxMANA)
				doCreatureAddHealth(cid,  maxHP)
					exhaustion.set(cid,61266,60)
		else
			doPlayerSendCancel(cid,"You cannot rest.")
		end
	return true
end

Chciałbym by tutaj regenerowało tak jak na zasadzie tamtego, że zależne od lvla oraz by regenerował hp/manę aż będziemy mieli ją na max'a.

Pozdrawiam,
margoh.

@edit Nie wiedziałem jak to zrobić, więc zrobiłem tak ;c
 
Last edited:
jak go wytabujesz to pomyślimy

- - - Updated - - -

ok, ładnie wytabowałeś, to ładnie ci zedytuje;

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local storage = 50000
local wait = 0.7

		if exhaustion.get(cid, storage) == FALSE then
			REG_HEALTH = 5.6 * getPlayerLevel(cid)
			REG_MANA = 4.3 * getPlayerLevel(cid)
			doPlayerAddMana(cid, REG_MANA)
			doCreatureAddHealth(cid, REG_HEALTH)
			doRemoveItem(item.uid, 1)
			exhaustion.set(cid, storage, wait)
		else
			doPlayerSendCancel(cid, "You are exhausted.")
		end
return true
end
 
Dziękuję za poprawienie :)

@edit
A czy byłbyś jeszcze tak miły i poprawił ten drugi? Bardzo bym prosił :)

@edit
No prawie to samo xd tamto to item, a to jest czar xD
Jak go wlacze chce by leczyl na tej samej zasadzie co tamto, tylko by ladowalo do max hp i many, do tego gdy laduje mane i hp to by nie mozna bylo sie ruszyc.

Sr, ze bez polskich znakow ale pisze z tabletu xd
 
Last edited:
Back
Top