NB
pedido

Script De Teleport Quando Ganha Storage

Por nbb147, 10 de nov. de 2012 em Scripts

script
18
2.9k
nbb147N
10 de novembro de 2012 às 01:10

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

SkymagnumS
10 de novembro de 2012 às 02:20
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 Novembro 10 por Skymagnum

nbb147N
10 de novembro de 2012 às 03:16

cara todos perderam a storage, mais nenhum foi teleportado.. o.O

VodkartzinV
10 de novembro de 2012 às 07:54

check a coordenada da pos

nbb147N
10 de novembro de 2012 às 16:40

vixi ta dando um erro:

 

[10/11/2012 16:40:08] [Warning - Event::loadScript] Event onDeath not found (data/creaturescripts/scripts/mizuki teleport.lua)
MatheusVidaLokaM
10 de novembro de 2012 às 16:49
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 Novembro 10 por MatheusVidaLoka

VodkartzinV
10 de novembro de 2012 às 16:50

registou o event no seu monstro? e checou a tag?

nbb147N
10 de novembro de 2012 às 17:06

@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.

MatheusVidaLokaM
10 de novembro de 2012 às 17:11

Faz o seguinte, tira do creaturescript e coloca em moveements. Tem muitas chances de ser esse o erro.

nbb147N
10 de novembro de 2012 às 17:28

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 Novembro 10 por nbb147

VodkartzinV
10 de novembro de 2012 às 17:49

me passa o arquivo.xml do seu monstro e a tag que vc esta usando

nbb147N
10 de novembro de 2012 às 18:28

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"/>

VodkartzinV
10 de novembro de 2012 às 19:41
<?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>

nbb147N
10 de novembro de 2012 às 23:43

nao, cara vc tirou as outras creaturesscript do monster.xml..

essas outras estavam todas funcionando..

VodkartzinV
10 de novembro de 2012 às 23:47

mas deve estar dando conflito