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

problem z lua

straher

???
Joined
Mar 23, 2010
Messages
255
Reaction score
3
w support nikt chyba nie znal rozwiazania wiec probuje tutaj

mam taki skrypt:

Lua:
function onKill(cid, target, lastHit)
	if cid ~= target and isPlayer(target) then
if(getPlayerStorageValue(cid, 20233) > 1) and getCreatureStorage(cid, 6001) == -1 then
		setPlayerStorageValue(cid, 6001, 1)
		doCreatureSetSkullType(cid, 1) 
 
	elseif(getPlayerStorageValue(cid, 20233) > 20) and getCreatureStorage(cid, 6002) == -1 then
		setPlayerStorageValue(cid, 6002, 1)
		doCreatureSetSkullType(cid, 2) -- 3 is red
 
	elseif(getPlayerStorageValue(cid, 20233) > 50) and getCreatureStorage(cid, 6003) == -1 then
		setPlayerStorageValue(cid, 6003, 1)
		doCreatureSetSkullType(cid, 3) -- 5 is black
 
	elseif(getPlayerStorageValue(cid, 20233) > 100) and getCreatureStorage(cid, 6005) == -1 then
		setPlayerStorageValue(cid, 6005, 1)
doCreatureSetSkullType(cid, 4)
 
	elseif(getPlayerStorageValue(cid, 20233) > 150) and getCreatureStorage(cid, 6006) == -1 then
		setPlayerStorageValue(cid, 6006, 1)
	doCreatureSetSkullType(cid, 5)
end
end
	return true
end

w konsoli nie wyrzuca zadnych bledow, ale skulli tez nie ustawia
 
Możesz mi wyjaśnić co to w ogole ma robic?

Raz używasz getPlayerStorageValue, a raz getCreatureStorage. xd?

Powiększa się chociaż ten storage 20233? :D
 
najpierw spróbuj wywalić wszystkie warunki, potem je dodawaj po kolei żeby zobaczyć w którym jest błąd
 
Możesz mi wyjaśnić co to w ogole ma robic?

Raz używasz getPlayerStorageValue, a raz getCreatureStorage. xd?

Powiększa się chociaż ten storage 20233? :D

storage sie powieksza bo od powiekszania jest inny skrypt zwiazany z fragami a ze skrypter lua ze mnie zaden to robilem tak jak wydawalo mi sie sluszne

a co ma robic

sprawdzac ilosc danego storage i na tej podstawie ustawiac odpowiednia czaszke (war serwer)
 
Last edited:
Lua:
function onKill(cid, target, lastHit)

	local cfg = {
		--skullType, jakies str i value.
		[1] = {6001, 1},
		[2] = {6002, 20},
		[3] = {6003, 50},
		[4] = {6004, 100},
		[5] = {6005, 150}
	}


	if cid == target or not(isPlayer(target)) then
		return true
	end
		
	for s, d in ipairs(cfg) do
		if(getCreatureStorage(cid, d[1]) < 0 and getPlayerStorageValue(cid, 20233) > d[2])then
			setPlayerStorageValue(cid, d[1], 1)
			doCreatureSetSkullType(cid, s)
		end
	end
	return true
end


Pewnie można lepiej, ale mam to w dupie.

Jak Ci nie działa dalej, to sobie zmień w tablicy [1], [2],[3] itd. na SKULL_YELLOW, WHITE, BLACK, SRACK :p
 
Back
Top