GU
action

alguem porderia me da uma maozinha com esses dois scripts

Por gusinhi, 13 de abr. de 2016 em Scripts

8
923
gusinhiG
13 de abril de 2016 às 17:41
function onKill(cid, target, lastHit)config = {NickBoss = "Ferumbras",StoragePorta = 666}if isMonster(target) then	if getCreatureName(target) == config.NickBoss then				setPlayerStorageValue(cid, config.StoragePorta, 1)		doPlayerSendTextMessage(cid, 18, "'You defeated me..now you can open the door.")	return true	endendreturn trueend

 

 

Action da porta

function onUse(cid, item, fromPosition, itemEx, toPosition)if item.actionid == 666 thenif getPlayerStorageValue(cid, 666) ~= 1 thenreturn doPlayerSendTextMessage(cid, 27, "The door seems to be sealed against unwanted intruders.")endreturn trueend

 

Editado Abril 13 por gusinhi

miguel223M
13 de abril de 2016 às 17:51

Creaturescripts (registre no login.lua e adicione a tag de kill no .xml):

 

function onKill(cid, target)

 

if isPlayer(cid) and isCreature(target) then

 

if getCreatureName(target) == "Ferumbras" then

setPlayerStorageValue(cid, 666, 1)

doPlayerSendTextMessage(cid, 22, "Voce liberou o acesso, jogador!")

doSendMagicEffect(getPlayerPosition(cid), 6)

end

 

end

 

return true

end

 

Actions (crie uma tag de actionid no .xml):

 

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

  if getPlayerStorageValue(cid, 666) == 1 then

   if getPlayerPosition(cid).x < getThingPosition(item.uid).x then
   doTeleportThing(cid, {x = getThingPosition(item.uid).x + 1, y = getThingPosition(item.uid).y,  z = getThingPosition(item.uid).z})

   doSendMagicEffect(getPlayerPosition(cid), 12)

   elseif getPlayerPosition(cid).x > getThingPosition(item.uid).x then
   doTeleportThing(cid, {x = getThingPosition(item.uid).x - 1, y = getThingPosition(item.uid).y,  z = getThingPosition(item.uid).z})

   doSendMagicEffect(getPlayerPosition(cid), 12)
   end

  end

return true
end


   

miguel223M
13 de abril de 2016 às 17:52

Creaturescripts (registre no login.lua e adicione a tag de kill no .xml):

 

function onKill(cid, target)

 

if isPlayer(cid) and isCreature(target) then

 

if getCreatureName(target) == "Ferumbras" then

setPlayerStorageValue(cid, 666, 1)

doPlayerSendTextMessage(cid, 22, "Voce liberou o acesso, jogador!")

doSendMagicEffect(getPlayerPosition(cid), 6)

end

 

end

 

return true

end

 

Actions (crie uma tag de actionid no .xml):

 

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

  if getPlayerStorageValue(cid, 666) == 1 then

   if getPlayerPosition(cid).x < getThingPosition(item.uid).x then
   doTeleportThing(cid, {x = getThingPosition(item.uid).x + 1, y = getThingPosition(item.uid).y,  z = getThingPosition(item.uid).z})

   doSendMagicEffect(getPlayerPosition(cid), 12)

   elseif getPlayerPosition(cid).x > getThingPosition(item.uid).x then
   doTeleportThing(cid, {x = getThingPosition(item.uid).x - 1, y = getThingPosition(item.uid).y,  z = getThingPosition(item.uid).z})

   doSendMagicEffect(getPlayerPosition(cid), 12)
   end

  end

return true
end


   

PoccnnP
13 de abril de 2016 às 17:53

Precisa de um end para fechar a função onuse ()

Precisa também transformar o id da porta fechada em aberta.

miguel223M
13 de abril de 2016 às 18:07

Poc, se voce prestar bem atenção, você vai ver q o último end já eh do function e que eu nao alterei a porta, mas sim fiz o player tomar tp de um lado pra outro......

gusinhiG
13 de abril de 2016 às 18:09

Agora foii valew ai pela ajuda :laugh:

gusinhiG
13 de abril de 2016 às 18:18

eu foi ver isso agr, vlw pela ajuda 

PoccnnP
14 de abril de 2016 às 12:42
18 horas atrás, miguel223 disse:

Poc, se voce prestar bem atenção, você vai ver q o último end já eh do function e que eu nao alterei a porta, mas sim fiz o player tomar tp de um lado pra outro......

 

Não estava contestando seu script e sim o do qual ele postou.

Citar

function onUse(cid, item, fromPosition, itemEx, toPosition) if item.actionid == 666 then if getPlayerStorageValue(cid, 666) ~= 1 then return doPlayerSendTextMessage(cid, 27, "The door seems to be sealed against unwanted intruders.") end return true end