KA

[Script] StorageValue

Por KarlKalvin, 23 de ago. de 2016 em Scripts

storage
collect
profissao
pxg
46
5.4k
KarlKalvinK
25 de agosto de 2016 às 13:57
6 horas atrás, Drazyn disse:
function onUse(cid, item, frompos, item2, topos)	print("inicio")	local chance = 10 -- chance de cortar	local madeiras = {17180, 17081, 17182, 17183} -- item que o player irá ganhar	local premio = madeiras[math.random(1, #madeiras)]	local texts = {"Coletando Informações..."} -- texto que irá aparecer quando usar o item	local randoms = texts[math.random(1,#texts)]	local time = 2 -- Segundos de outfit coletando informações	local outfit = 38 -- ID da Outfit Male.	local outfit2 = 31 -- ID da Outfit Female.		if isRiderOrFlyOrSurf(cid) then		return doPlayerSendCancel(cid, MSG_NAO_E_POSSIVEL)	end		local name = getItemNameById(item2.itemid)	if not name:find("fainted") then		doPlayerSendCancel(cid, MSG_NAO_E_POSSIVEL)		return true	end	print("nao esta de fly")	if getPlayerStorageValue(cid, 12015) ~= 1 then		doPlayerSendCancel(cid, "Nao pode.")		return true	end		if getPlayerSex(cid) == 1 then		doSetCreatureOutfit(cid, {lookType = outfit, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, time*1*1000)		print("male")	else		doSetCreatureOutfit(cid, {lookType = outfit2, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, time*1*1000)		print("female")	end		doCreatureSetNoMove(cid, true)	addEvent(function()		if not isPlayer(cid) then return true end		doCreatureSetNoMove(cid, false)	end, 1000)			local name = getItemNameById(item2.itemid) 	if name:find("fainted") and item2.actionid ~= 4432 then		print("isCorpse and not have a actionid")		if math.random(1,100) >= chance then			print("chance >")			doItemSetAttribute(item2.uid, "aid", 4432)			doSendAnimatedText(topos, ""..randoms.."", TEXTCOLOR_GREEN)			item = doCreateItemEx(premio, math.random(2,5))			doItemSetAttribute(item, "unique", getCreatureName(cid))			doPlayerAddItemEx(cid, item)			addEvent(function()				doCreatureSetNoMove(cid, false)				doPlayerSendTextMessage(cid, 22, "Você coletou informações e ganhou pontos.")				print("nao coletou")			end, time * 1000)		else			print("chance < ")			doItemSetAttribute(item2.uid, "aid", 4432)			doSendAnimatedText(topos, ""..randoms.."", TEXTCOLOR_GREEN)			addEvent(function()				doCreatureSetNoMove(cid, false)				doPlayerSendTextMessage(cid,22,"Você não conseguiu coletar.")	              	print("nao coletou")			end, time * 1000)		end	end	return trueend

Usa esse script, executa o action e me manda print do que aparece na tela...

 

Ok. vou testar!