Ir para conteúdo
  • 0

Tumb Servant


markimbozi

Pergunta

Gostaria de saber como faz para aumentar a chance de quebrar o vaso, pois eu quero que quebre toda hora quando clicar e não ter chance

local config = {
	randomText = {"Waaaaaah", "You are too afraid to destroy this object"},
}

function onUse(cid, item, fromPosition, itemEx, toPosition)

local exaustedSeconds = 30
local player = Player(cid)
local chances = math.random(10)


if item.actionid == 56530 then 	
	if(item.itemid == 13736) then	
		if getPlayerStorageValue(cid, 324329) <= os.time() then
			if chances == 1 then						
			doTransformItem(item.uid, 13495)					

			-- Sumonar Boss
			 doCreatureSay(cid, "The horestis tomb was broken, the boss of the tomb will be reborn in 45 seconds. The barrier will be built from here 10 minutes.", TALKTYPE_ORANGE_1)
			 addEvent(doSummonCreature, 45*1000, "Horestis", {x = 32943, y = 32795, z = 12}) 
			else	
			player:say(config["randomText"][math.random(#config["randomText"])], TALKTYPE_ORANGE_1)
			player:getPosition():sendMagicEffect(CONST_ME_POFF)
			setPlayerStorageValue(cid, 324329, os.time()+exaustedSeconds*60)
		end
	else
			doPlayerSendCancel(cid, "You need wait 30 minutes to use again.")
		end
	end

elseif item.actionid == 56531 then
	if(item.itemid == 13500) then 
		if(getGlobalStorageValue(56531) < 1) then	
			if getPlayerStorageValue(cid, 324330) <= os.time() then
				if chances == 1 then								
				doTransformItem(item.uid, 13495) 					

			-- Sumonar Boss
			 doCreatureSay(cid, "The horestis tomb was broken, the boss of the tomb will be reborn in 45 seconds. The barrier will be built from here 10 minutes.", TALKTYPE_ORANGE_1)
			 addEvent(doSummonCreature, 45*1000, "Horestis", {x = 32943, y = 32795, z = 12}) 
				else
				player:say(config["randomText"][math.random(#config["randomText"])], TALKTYPE_ORANGE_1)
				player:getPosition():sendMagicEffect(CONST_ME_POFF)
				setPlayerStorageValue(cid, 324330, os.time()+exaustedSeconds*60)
				end
			else
				doPlayerSendCancel(cid, "You need wait 30 minutes to use again.")
				end
			else
				doPlayerSendCancel(cid, "You need to break the first jar.")
		end
	end

elseif item.actionid == 56532 then 	
	if(item.itemid == 13500) then 						
		if(getGlobalStorageValue(56532) < 1) then
			if getPlayerStorageValue(cid, 324331) <= os.time() then
				if chances == 1 then
				doTransformItem(item.uid, 13495) 					

			-- Sumonar Boss
			 doCreatureSay(cid, "The horestis tomb was broken, the boss of the tomb will be reborn in 45 seconds. The barrier will be built from here 10 minutes.", TALKTYPE_ORANGE_1)
			 addEvent(doSummonCreature, 45*1000, "Horestis", {x = 32943, y = 32795, z = 12}) 
				else	
				player:say(config["randomText"][math.random(#config["randomText"])], TALKTYPE_ORANGE_1)
				player:getPosition():sendMagicEffect(CONST_ME_POFF)
				setPlayerStorageValue(cid, 324331, os.time()+exaustedSeconds*60)
				end
			else
				doPlayerSendCancel(cid, "You need wait 30 minutes to use again.")
				end
			else
				doPlayerSendCancel(cid, "You need to break the second jar.")
			end
		end


elseif item.actionid == 56533 then
	if(item.itemid == 13500) then  							
		if(getGlobalStorageValue(56533) < 1) then
			if getPlayerStorageValue(cid, 324332) <= os.time() then	
				if chances == 1 then
				doTransformItem(item.uid, 13495) 					

			-- Sumonar Boss
			 doCreatureSay(cid, "The horestis tomb was broken, the boss of the tomb will be reborn in 45 seconds. The barrier will be built from here 10 minutes.", TALKTYPE_ORANGE_1)
			 addEvent(doSummonCreature, 45*1000, "Horestis", {x = 32943, y = 32795, z = 12}) 
			else	
				player:say(config["randomText"][math.random(#config["randomText"])], TALKTYPE_ORANGE_1)
				player:getPosition():sendMagicEffect(CONST_ME_POFF)
				setPlayerStorageValue(cid, 324332, os.time()+exaustedSeconds*60)
				end
			else
				doPlayerSendCancel(cid, "You need wait 30 minutes to use again.")
				end
			else
				doPlayerSendCancel(cid, "You need to break the third jar.")
		end
	end

elseif item.actionid == 56534 then
	if(item.itemid == 13736) then  							
		if(getGlobalStorageValue(56534) < 1) then
			if getPlayerStorageValue(cid, 324333) <= os.time() then	
				if chances == 1 then
				doTransformItem(item.uid, 13495) 					

			-- Sumonar Boss
			 doCreatureSay(cid, "The horestis tomb was broken, the boss of the tomb will be reborn in 45 seconds. The barrier will be built from here 10 minutes.", TALKTYPE_ORANGE_1)
			 addEvent(doSummonCreature, 45*1000, "Horestis", {x = 32943, y = 32795, z = 12}) 
			else	
				player:say(config["randomText"][math.random(#config["randomText"])], TALKTYPE_ORANGE_1)
				player:getPosition():sendMagicEffect(CONST_ME_POFF)
				setPlayerStorageValue(cid, 324333, os.time()+exaustedSeconds*60)
				end
			else
				doPlayerSendCancel(cid, "You need wait 30 minutes to use again.")
				end
			else
				doPlayerSendCancel(cid, "You need to break the third jar.")
		end
	end
end
	return true
end
Link para o comentário
Compartilhar em outros sites

1 resposta a esta questão

Posts Recomendados

  • 0

Tenta assim:

local config = {
	randomText = {"Waaaaaah", "You are too afraid to destroy this object"},
}

function onUse(cid, item, fromPosition, itemEx, toPosition)

local exaustedSeconds = 30
local player = Player(cid)
local chances = math.random(1,1)


if item.actionid == 56530 then 	
	if(item.itemid == 13736) then	
		if getPlayerStorageValue(cid, 324329) <= os.time() then
			if chances == 1 then						
			doTransformItem(item.uid, 13495)					

			-- Sumonar Boss
			 doCreatureSay(cid, "The horestis tomb was broken, the boss of the tomb will be reborn in 45 seconds. The barrier will be built from here 10 minutes.", TALKTYPE_ORANGE_1)
			 addEvent(doSummonCreature, 45*1000, "Horestis", {x = 32943, y = 32795, z = 12}) 
			else	
			player:say(config["randomText"][math.random(#config["randomText"])], TALKTYPE_ORANGE_1)
			player:getPosition():sendMagicEffect(CONST_ME_POFF)
			setPlayerStorageValue(cid, 324329, os.time()+exaustedSeconds*60)
		end
	else
			doPlayerSendCancel(cid, "You need wait 30 minutes to use again.")
		end
	end

elseif item.actionid == 56531 then
	if(item.itemid == 13500) then 
		if(getGlobalStorageValue(56531) < 1) then	
			if getPlayerStorageValue(cid, 324330) <= os.time() then
				if chances == 1 then								
				doTransformItem(item.uid, 13495) 					

			-- Sumonar Boss
			 doCreatureSay(cid, "The horestis tomb was broken, the boss of the tomb will be reborn in 45 seconds. The barrier will be built from here 10 minutes.", TALKTYPE_ORANGE_1)
			 addEvent(doSummonCreature, 45*1000, "Horestis", {x = 32943, y = 32795, z = 12}) 
				else
				player:say(config["randomText"][math.random(#config["randomText"])], TALKTYPE_ORANGE_1)
				player:getPosition():sendMagicEffect(CONST_ME_POFF)
				setPlayerStorageValue(cid, 324330, os.time()+exaustedSeconds*60)
				end
			else
				doPlayerSendCancel(cid, "You need wait 30 minutes to use again.")
				end
			else
				doPlayerSendCancel(cid, "You need to break the first jar.")
		end
	end

elseif item.actionid == 56532 then 	
	if(item.itemid == 13500) then 						
		if(getGlobalStorageValue(56532) < 1) then
			if getPlayerStorageValue(cid, 324331) <= os.time() then
				if chances == 1 then
				doTransformItem(item.uid, 13495) 					

			-- Sumonar Boss
			 doCreatureSay(cid, "The horestis tomb was broken, the boss of the tomb will be reborn in 45 seconds. The barrier will be built from here 10 minutes.", TALKTYPE_ORANGE_1)
			 addEvent(doSummonCreature, 45*1000, "Horestis", {x = 32943, y = 32795, z = 12}) 
				else	
				player:say(config["randomText"][math.random(#config["randomText"])], TALKTYPE_ORANGE_1)
				player:getPosition():sendMagicEffect(CONST_ME_POFF)
				setPlayerStorageValue(cid, 324331, os.time()+exaustedSeconds*60)
				end
			else
				doPlayerSendCancel(cid, "You need wait 30 minutes to use again.")
				end
			else
				doPlayerSendCancel(cid, "You need to break the second jar.")
			end
		end


elseif item.actionid == 56533 then
	if(item.itemid == 13500) then  							
		if(getGlobalStorageValue(56533) < 1) then
			if getPlayerStorageValue(cid, 324332) <= os.time() then	
				if chances == 1 then
				doTransformItem(item.uid, 13495) 					

			-- Sumonar Boss
			 doCreatureSay(cid, "The horestis tomb was broken, the boss of the tomb will be reborn in 45 seconds. The barrier will be built from here 10 minutes.", TALKTYPE_ORANGE_1)
			 addEvent(doSummonCreature, 45*1000, "Horestis", {x = 32943, y = 32795, z = 12}) 
			else	
				player:say(config["randomText"][math.random(#config["randomText"])], TALKTYPE_ORANGE_1)
				player:getPosition():sendMagicEffect(CONST_ME_POFF)
				setPlayerStorageValue(cid, 324332, os.time()+exaustedSeconds*60)
				end
			else
				doPlayerSendCancel(cid, "You need wait 30 minutes to use again.")
				end
			else
				doPlayerSendCancel(cid, "You need to break the third jar.")
		end
	end

elseif item.actionid == 56534 then
	if(item.itemid == 13736) then  							
		if(getGlobalStorageValue(56534) < 1) then
			if getPlayerStorageValue(cid, 324333) <= os.time() then	
				if chances == 1 then
				doTransformItem(item.uid, 13495) 					

			-- Sumonar Boss
			 doCreatureSay(cid, "The horestis tomb was broken, the boss of the tomb will be reborn in 45 seconds. The barrier will be built from here 10 minutes.", TALKTYPE_ORANGE_1)
			 addEvent(doSummonCreature, 45*1000, "Horestis", {x = 32943, y = 32795, z = 12}) 
			else	
				player:say(config["randomText"][math.random(#config["randomText"])], TALKTYPE_ORANGE_1)
				player:getPosition():sendMagicEffect(CONST_ME_POFF)
				setPlayerStorageValue(cid, 324333, os.time()+exaustedSeconds*60)
				end
			else
				doPlayerSendCancel(cid, "You need wait 30 minutes to use again.")
				end
			else
				doPlayerSendCancel(cid, "You need to break the third jar.")
		end
	end
end
	return true
end

~Tópico movido pra área correta

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...