Ir para conteúdo
  • 0

Script De Teleport Quando Ganha Storage


nbb147

Pergunta

galera alguem mim ajuda com esse script, ele funciona da seguinte forma ele teporta o player quando ele matar certo monstro, eu quero modificar ele para quando o player receber certa storage ele ser teleportado, abaixo o script:

 

 

 

function onDeath(cid, corpse, deathList)

local Ppos,monstName = {x = 3114, y = 3049, z = 7},"Mizuki"

if isMonster(cid) and string.lower(getCreatureName(cid)) == string.lower(monstName) then

for _, check in pairs(deathList) do

if isPlayer(check) then

doTeleportThing(check, Ppos)

end

end

end

return true

end

Link para o comentário
Compartilhar em outros sites

Posts Recomendados

  • 0
function onDeath(cid, corpse, deathList)

local Ppos, monstName = {x = 3114, y = 3049, z = 7}, "Mizuki"
local storageW = 3939 -- storage que ganha

if isMonster(cid) and string.lower(getCreatureName(cid)) == string.lower(monstName) then
for _, check in pairs(deathList) do
	if isPlayer(check) then
		 doTeleportThing(check, Ppos)
			 setPlayerStorageValue(check, storageW, 1)
				   end
				end
			end
  return true
end

Editado por Skymagnum
Link para o comentário
Compartilhar em outros sites

  • 0
local positionGo = {x=123,y=543,z=7} -- posição que vai.
local storageNeed = 4304 -- storage que precisa.

function onStepIn(cid, item, topos)
if isPlayer(cid) and getPlayerStorageValue(cid, storageNeed) > 0 then
	doTeleportThing(cid, positionGo)
	doSendMagicEffect(positionGo, 10)
end
return true
end

 

Creditos: Jhon992

 

Tenta esse, funciona assim: Quando você tiver storage x o player vai no piso y e é automaticamente teleportado para algum lugar.

Editado por MatheusVidaLoka
Link para o comentário
Compartilhar em outros sites

  • 0

@MatheusVidaLoka

 

ta dando esse erro no creaturescript:

 

 

 

[10/11/2012 17:04:12] [Error - CreatureEvent::configureEvent] No valid type for creature event.StepIn

[10/11/2012 17:04:12] [Warning - BaseEvents::loadFromXml] Cannot configure an event

 

@Vodkartzin

 

sim, esta tudo certo tanto no monstro, como no creaturescript.xml.

Link para o comentário
Compartilhar em outros sites

  • 0

cara acho que vc nao entendeu o que eu quero eu quero um script que o quando o player ganhe certa storage ele seja teleportado, para x, y, z cordenadas..

Editado por nbb147
Link para o comentário
Compartilhar em outros sites

  • 0

monster xml:

 

 

 

<?xml version="1.0" encoding="utf-8"?>
<monster name="mizuki" namedescription="a mizuki" race="blood" experience="6000" speed="215" manacost="0">
 <health now="600" max="600"/>
 <look type="81" corpse="0"/>
 <targetchange interval="2000" chance="0"/>
 <strategy attack="100" defense="0"/>
 <flags>
   <flag summonable="0"/>
   <flag attackable="1"/>
   <flag hostile="1"/>
   <flag illusionable="1"/>
   <flag convinceable="1"/>
   <flag pushable="0"/>
   <flag canpushitems="1"/>
   <flag canpushcreatures="0"/>
   <flag targetdistance="1"/>
   <flag staticattack="90"/>
   <flag runonhealth="0"/>
 </flags>
 <attacks>
   <attack name="melee" interval="2000" skill="40" attack="34"/>
 </attacks>
 <defenses armor="10" defense="7"/>
   <elements>
 <element icePercent="0"/>
 <element holyPerent="0"/>
 <element earthPercent="0"/>
 <element deathPercent="0"/>
 </elements>
 <script>
       <event name="Mizuki"/>
 </script>
 <immunities>
   <immunity physical="0"/>
   <immunity energy="0"/>
   <immunity fire="0"/>
   <immunity poison="0"/>
   <immunity lifedrain="0"/>
   <immunity paralyze="0"/>
   <immunity outfit="0"/>
   <immunity drunk="0"/>
   <immunity invisible="0"/>
 </immunities>
 <voices interval="5000" chance="10">
   <voice sentence="Mim da esse pergaminho agora!"/>
   <voice sentence="Voce vai morrer como o iruka morreu."/>
 </voices>
 <loot>
   <item id="2148" countmax="26" chance1="50000" chancemax="0"/>
   <item id="2148" countmax="14" chance1="90000" chancemax="0"/>
 </loot>
 <script>
  <event name="RemoveStorage"/>
 </script>
 <script>
<event name="MizukiTeleport"/>
 </script>
 <script>
<event name="Testar"/>
 </script>
</monster>

 

tag creatures.xml:

 

<event type="death" name="MizukiTeleport" event="script" value="mizuki teleport.lua"/>

Link para o comentário
Compartilhar em outros sites

  • 0
<?xml version="1.0" encoding="utf-8"?>
<monster name="mizuki" namedescription="a mizuki" race="blood" experience="6000" speed="215" manacost="0">
 <health now="600" max="600"/>
 <look type="81" corpse="0"/>
 <targetchange interval="2000" chance="0"/>
 <strategy attack="100" defense="0"/>
 <flags>
   <flag summonable="0"/>
   <flag attackable="1"/>
   <flag hostile="1"/>
   <flag illusionable="1"/>
   <flag convinceable="1"/>
   <flag pushable="0"/>
   <flag canpushitems="1"/>
   <flag canpushcreatures="0"/>
   <flag targetdistance="1"/>
   <flag staticattack="90"/>
   <flag runonhealth="0"/>
 </flags>
 <attacks>
   <attack name="melee" interval="2000" skill="40" attack="34"/>
 </attacks>
 <defenses armor="10" defense="7"/>
   <elements>
 <element icePercent="0"/>
 <element holyPerent="0"/>
 <element earthPercent="0"/>
 <element deathPercent="0"/>
 </elements>
 <script>
       <event name="Mizuki"/>
 </script>
 <immunities>
   <immunity physical="0"/>
   <immunity energy="0"/>
   <immunity fire="0"/>
   <immunity poison="0"/>
   <immunity lifedrain="0"/>
   <immunity paralyze="0"/>
   <immunity outfit="0"/>
   <immunity drunk="0"/>
   <immunity invisible="0"/>
 </immunities>
 <voices interval="5000" chance="10">
   <voice sentence="Mim da esse pergaminho agora!"/>
   <voice sentence="Voce vai morrer como o iruka morreu."/>
 </voices>
 <loot>
   <item id="2148" countmax="26" chance1="50000" chancemax="0"/>
   <item id="2148" countmax="14" chance1="90000" chancemax="0"/>
 </loot>
<script>
<event name="MizukiTeleport"/>
</script>
</monster>

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...