• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[TFS][8.31][0.3]script?

redbull915

I learn...
Joined
Oct 10, 2008
Messages
235
Reaction score
0
Location
Poland/Radom
Is someone can check my script? Because my engine is not running!
this is code
Code:
function onStepOut(cid, item, pos)
local monster1pos = {x=191, y=124, z=7}   -- Pozycja 1 monstera
local monster2pos = {x=191, y=126, z=7}   -- Pozycja 2 monstera
local monster1 = getThingfromPos(monster1pos)
local monster2 = getThingfromPos(monster2pos)
local efekt = 53 -- Efekt
local ile_hp1 = 2400000  -- Ile hp ma potwor 1
local ile_hp2 = 2400000  -- Ile hp ma potwor 2
doCreatureAddHealth(monster1, -ile_hp1)
doCreatureAddHealth(monster2, -ile_hp2)
doSendMagicEffect(monster1pos, efekt)
doSendMagicEffect(monster2pos, efekt)
end
And this from my Engine ss.

plz help me.
 
Try adding stackpos = 255 in position definitions, also:

doCreatureAddHealth(monster1.uid, -getCreatureHealth(monster1.uid))
 
sry 2 post
can you cheak this script
Code:
function onStepOut(cid, item, pos)
local monster1pos = {x=191, y=124, z=7}   -- Pozycja 1 monstera
local monster2pos = {x=191, y=126, z=7}   -- Pozycja 2 monstera
local monster1 = getThingfromPos(monster1pos)
local monster2 = getThingfromPos(monster2pos)
local efekt = 53 -- Efekt
doRemoveCreature(monster1pos)
doRemoveCreature(monster2pos)
doSendMagicEffect(monster1pos, efekt)
doSendMagicEffect(monster2pos, efekt)
end

I want to do similar trein peace, as are in the wypasots are.
 
Last edited:
sry 2 post
can you cheak this script
Code:
function onStepOut(cid, item, pos)
local monster1pos = {x=191, y=124, z=7}   -- Pozycja 1 monstera
local monster2pos = {x=191, y=126, z=7}   -- Pozycja 2 monstera
local monster1 = getThingfromPos(monster1pos)
local monster2 = getThingfromPos(monster2pos)
local efekt = 53 -- Efekt
doRemoveCreature(monster1pos)
doRemoveCreature(monster2pos)
doSendMagicEffect(monster1pos, efekt)
doSendMagicEffect(monster2pos, efekt)
end

I want to do similar trein peace, as are in the wypasots are.

Add stackpos = 255... again o.o
 
function onStepOut(cid, item, pos)
local monster1pos = {x=191, y=124, z=7, stackpos = 255} -- Pozycja 1 monstera
local monster2pos = {x=191, y=126, z=7, stackpos = 255} -- Pozycja 2 monstera
local monster1 = getThingfromPos(monster1pos)
local monster2 = getThingfromPos(monster2pos)
local efekt = 53 -- Efekt
doRemoveCreature(monster1pos)
doRemoveCreature(monster2pos)
doSendMagicEffect(monster1pos, efekt)
doSendMagicEffect(monster2pos, efekt)
end
 
Can someone tell me what is evil in this script?

We request that the item was the uid.


first stepin
PHP:
function onStepIn(cid, item, pos)
local monster1 = "Trainer2"  -- Nazwa 1 monstera
local monster2 = "Trainer2"  -- Nazwa 2 monstera
local monster1pos = {x=191, y=136, z=7}   -- Pozycja 1 monstera
local monster2pos = {x=191, y=138, z=7}   -- Pozycja 2 monstera
local efekt = 255   -- Efekt, gdy potwory sie pojawiaja
doRemoveItem(10010, 8961)
doRemoveItem(10009, 8961)
doSummonCreature(monster1, monster1pos)
doSummonCreature(monster2, monster2pos)
doSendMagicEffect(monster1pos, efekt)
doSendMagicEffect(monster2pos, efekt)
end
second stepout
PHP:
function onStepOut(cid, item, pos)
local monster1pos = {x=191, y=136, z=7, stackpos=255}   -- Pozycja 1 monstera
local monster2pos = {x=191, y=138, z=7, stackpos=255}   -- Pozycja 2 monstera
local efekt = 45
doRemoveCreature(monster1pos)
doRemoveCreature(monster2pos)
doCreateItem(8961, 1, monster1pos)
doCreateItem(8961, 1, monster2pos)
doSendMagicEffect(monster1pos, efekt)
doSendMagicEffect(monster2pos, efekt)
end

this wrong in engine
PHP:
[10/11/2008 18:44:27] Lua Script Error: [MoveEvents Interface]  
[10/11/2008 18:44:27] data/movements/scripts/super treinerOut.lua:onStepOut 
[10/11/2008 18:44:27] luaDoRemoveCreature(). Creature not found 
[10/11/2008 18:44:27] Lua Script Error: [MoveEvents Interface]  
[10/11/2008 18:44:27] data/movements/scripts/super treinerOut.lua:onStepOut 
[10/11/2008 18:44:27] luaDoRemoveCreature(). Creature not found

http://www.youtube.com/v/VXBhKlKgd-E
 
Last edited:
PHP:
function onStepOut(cid, item, pos)
local efekt = 45
doRemoveCreature(getThingfromPos({x=191, y=136, z=7, stackpos=255}).uid)
doRemoveCreature(getThingfromPos({x=191, y=138, z=7, stackpos=255}).uid)
doCreateItem(8961, 1, monster1pos)
doCreateItem(8961, 1, monster2pos)
doSendMagicEffect(monster1pos, efekt)
doSendMagicEffect(monster2pos, efekt)
end
 
PHP:
function onStepOut(cid, item, pos)
local efekt = 45
doRemoveCreature(getThingfromPos({x=191, y=136, z=7, stackpos=255}).uid)
doRemoveCreature(getThingfromPos({x=191, y=138, z=7, stackpos=255}).uid)
doCreateItem(8961, 1, monster1pos)
doCreateItem(8961, 1, monster2pos)
doSendMagicEffect(monster1pos, efekt)
doSendMagicEffect(monster2pos, efekt)
end

monster1pos and moster2pos returns nil.
 
monster1pos and moster2pos returns nil.

o lol i just forgot that XD


PHP:
function onStepOut(cid, item, pos)
local efekt = 45
local monster1pos = {x=191, y=136, z=7, stackpos=255}   -- Pozycja 1 monstera
local monster2pos = {x=191, y=138, z=7, stackpos=255}   -- Pozycja 2 monstera 
doRemoveCreature(getThingfromPos(monster1pos).uid)
doRemoveCreature(getThingfromPos(monster2pos).uid)
doCreateItem(8961, 1, monster1pos)
doCreateItem(8961, 1, monster2pos)
doSendMagicEffect(monster1pos, efekt)
doSendMagicEffect(monster2pos, efekt)
end
 
Now we can not find item.

thanks monster Shut down.

PHP:
[11/11/2008 19:51:19] Lua Script Error: [MoveEvents Interface] 
[11/11/2008 19:51:19] data/movements/scripts/super treinerIn.lua:onStepIn

[11/11/2008 19:51:19] luaDoRemoveItem(). Item not found

[11/11/2008 19:51:19] Lua Script Error: [MoveEvents Interface] 
[11/11/2008 19:51:19] data/movements/scripts/super treinerIn.lua:onStepIn

[11/11/2008 19:51:19] luaDoRemoveItem(). Item not found
 
Now we can not find item.

thanks monster Shut down.

PHP:
[11/11/2008 19:51:19] Lua Script Error: [MoveEvents Interface] 
[11/11/2008 19:51:19] data/movements/scripts/super treinerIn.lua:onStepIn

[11/11/2008 19:51:19] luaDoRemoveItem(). Item not found

[11/11/2008 19:51:19] Lua Script Error: [MoveEvents Interface] 
[11/11/2008 19:51:19] data/movements/scripts/super treinerIn.lua:onStepIn

[11/11/2008 19:51:19] luaDoRemoveItem(). Item not found

Try with this one
PHP:
function onStepIn(cid, item, pos)
local monster1 = "Trainer2"  -- Nazwa 1 monstera
local monster2 = "Trainer2"  -- Nazwa 2 monstera
local monster1pos = {x=191, y=136, z=7, stackpos=1}   -- Pozycja 1 monstera
local monster2pos = {x=191, y=138, z=7, stackpos=1}   -- Pozycja 2 monstera
local efekt = 255   -- Efekt, gdy potwory sie pojawiaja
doRemoveItem(getThingfromPos(monster1pos).uid, 1)
doRemoveItem(getThingfromPos(monster2pos).uid, 1)
doSummonCreature(monster1, monster1pos)
doSummonCreature(monster2, monster2pos)
doSendMagicEffect(monster1pos, efekt)
doSendMagicEffect(monster2pos, efekt)
end

BTW you use much local and make the script look bad xD
 
Try with this one
PHP:
function onStepIn(cid, item, pos)
local monster1 = "Trainer2"  -- Nazwa 1 monstera
local monster2 = "Trainer2"  -- Nazwa 2 monstera
local monster1pos = {x=191, y=136, z=7, stackpos=1}   -- Pozycja 1 monstera
local monster2pos = {x=191, y=138, z=7, stackpos=1}   -- Pozycja 2 monstera
local efekt = 255   -- Efekt, gdy potwory sie pojawiaja
doRemoveItem(getThingfromPos(monster1pos).uid, 1)
doRemoveItem(getThingfromPos(monster2pos).uid, 1)
doSummonCreature(monster1, monster1pos)
doSummonCreature(monster2, monster2pos)
doSendMagicEffect(monster1pos, efekt)
doSendMagicEffect(monster2pos, efekt)
end
BTW you use much local and make the script look bad xD

Who cares if it looks bad? Use as much locals as possible. It's much more effective than globals.
 
It's easy when you want something that disappeared from the position, no matter whether the item, or monster, something equivalent to stackpos - you have to add uid in the declaration of a variable, such as "monster.uid" instead of "monster", where the "monster" = getThingfromPosition(monster position)



//Please remove this post, not noticed that this issue has two pages.
 
Back
Top