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

dzwignia - monster

nowy tu

Banned User
Joined
Jul 6, 2013
Messages
4
Reaction score
0
witam. znalazlem jakis kod i delikatnie go przerobilem lecz nie dziala mi jak trzeba...
mianowicie chcialem aby dzwignia sie "ruszala"
i po dodaniu zaznaczonego tekstu... przestalo mi dzialac "glowne dzialanie" - natomiast dzwignia sie rusza....
;/

local nazwyPotworow = {"nook" , "owel"}
local exh = 5
local storage = 1414
function onUse(cid, item, frompos, item2, topos)
local monster = nazwyPotworow[math.random(1,#nazwyPotworow)]


if item.uid == 9977 and item.itemid == 1945 then
doTransformItem(item.uid,item.itemid+1)


if(getPlayerStorageValue(cid,storage) <= os.time()) then
local summon = doSummonCreature(monster,{x=1017, y=1017, z=7, stackpos=253})
doChallengeCreature(cid, summon)
doChallengeCreature(summon, cid)
setPlayerStorageValue(cid,storage,os.time()+exh)
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"Czeka cie walka z ".. monster .."!")

elseif item.uid == 9977 and item.itemid == 1946 then
doTransformItem(item.uid,item.itemid-1)
doPlayerSendCancel(cid,"Jestes noobem")
end


else
doPlayerSendCancel(cid,"You are exhausted.")
end
return TRUE
end
 
Last edited:
mam te potwory... mi sie zdaje ze po dodaniu tego transfer, to trzeba dodac jeszcze cos przed kolejnym warunkem if, ale nie jestem pewien

ale tak na logike to elseif dotyczy poprzedniego if , wiec trzeba cos tam inaczej to zrobic..jakies klamry dodac czy niewiem.. ;/

@edit

zrobilem nieco inaczej"
local nazwyPotworow = {"nook" , "owel"}
local exh = 5
local storage = 1414
function onUse(cid, item, frompos, item2, topos)
local monster = nazwyPotworow[math.random(1,#nazwyPotworow)]




if(getPlayerStorageValue(cid,storage) <= os.time()) then
local summon = doSummonCreature(monster,{x=1017, y=1017, z=7, stackpos=253})
doChallengeCreature(cid, summon)
doChallengeCreature(summon, cid)
setPlayerStorageValue(cid,storage,os.time()+exh)
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"Czeka cie walka z ".. monster .."!")

if item.uid == 9977 and item.itemid == 1945 then
doTransformItem(item.uid,item.itemid+1)

elseif item.uid == 9977 and item.itemid == 1946 then
doTransformItem(item.uid,item.itemid-1)
end


else
doPlayerSendCancel(cid,"You are exhausted.")
end
return TRUE
end
i niby dziala, jednak to nie jest ten efekt co chcialem, gdyz chcialem aby przy ID 1946 omijalo caly ten skrypt... wiec nadal prosilbym o wskazanie mi jak nalezy pogodzic te warunki ze sobą jezeli mam jedno if to zeby w niego w srodek dac kolejny if...?
 
Last edited:
Lua:
function onUse(cid, item, frompos, item2, topos)
local monster = nazwyPotworow[math.random(1,#nazwyPotworow)]
local nazwyPotworow = {"nook" , "owel"}
local exh = 5
local storage = 1414

	if item.uid == 9977 and item.itemid == 1945 then
		doTransformItem(item.uid,1946)

		if(getPlayerStorageValue(cid,storage) <= os.time()) then
			local summon = doSummonCreature(monster,{x=1017, y=1017, z=7, stackpos=253})
			doChallengeCreature(cid, summon)
			doChallengeCreature(summon, cid)
			setPlayerStorageValue(cid,storage,os.time()+exh)
			doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"Cz eka cie walka z ".. monster .."!")
		else
			doPlayerSendCancel(cid,"You are exhausted.")
		end

	elseif item.uid == 9977 and item.itemid == 1946 then
		doTransformItem(item.uid,1945)
		doPlayerSendCancel(cid,"Jestes noobem - a dim najwiekszym!!!")
	end

return TRUE
end

naucz się czytać skrypt, a nie byle jak go kopiować, najpierw skończ jedną funkcję, a potem zacznij następną
 
cos nie smiga to ;p
attempt to get length of global 'nazwyPotworow' <a nil value>

@edit

nie potrzebnie przemiesciles to:
local monster = nazwyPotworow[math.random(1,#nazwyPotworow)]
ale juz to postawilem spowrotem i all dziala ;p
 
Last edited:

Similar threads

  • Question
RevScripts Summon Item
Replies
8
Views
614
Back
Top