• 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!

[New] OnStepIn summoncreature...

Ates.tr

Im back
Joined
Nov 11, 2007
Messages
1,046
Reaction score
2
Location
Sweden
Does this work ???

Going to use... sorry for wrong thread... or its for release too ;)

Code:
-- Script was made by [A]tes {{//OTLAND.NET}}
-- Edited by Darkhaos
function onStepIn(cid, item, frompos, item2, topos)
local config = {
	tile = 407,
	uniqueid = 3000,
	monster = "Demon",
	spawn = {
		{ x = 30000, y = 30000, z = 7, stackpos = 1 },
		{ x = 30001, y = 30000, z = 7, stackpos = 1 },
		{ x = 30002, y = 30000, z = 7, stackpos = 1 },
		{ x = 30003, y = 30000, z = 7, stackpos = 1 }
	}
}

if item.uid == config.uniqueid and item.itemid == config.tile and setPlayerStorageValue(cid,15000,1) == TRUE then
	for i = 1, table.maxn(config.spawn) do
         doCreatureSay(cid, "TEXT_TEXT.", TALKTYPE_ORANGE_1)
		 doSummonCreature(config.monster, config.spawn[i])
else
         doPlayerSendCancel(cid, "TEXT_TEXT.")
		 	end
		return TRUE
	end
end
 
Last edited:
Try this =D!

Code:
[COLOR="Blue"]function onStepIn(cid, item, frompos, item2, topos)
local config = {
	tile = [COLOR="DarkGreen"]407[/COLOR],
	uniqueid = [COLOR="DarkGreen"]3000[/COLOR],
	monster = [COLOR="DarkGreen"]"Demon"[/COLOR],
	spawn = {
		{ x = [COLOR="DarkGreen"]30000[/COLOR], y = [COLOR="DarkGreen"]30000[/COLOR], z = [COLOR="DarkGreen"]7[/COLOR], stackpos = [COLOR="DarkGreen"]1[/COLOR] },
		{ x = [COLOR="DarkGreen"]30001[/COLOR], y = [COLOR="DarkGreen"]30000[/COLOR], z = [COLOR="DarkGreen"]7[/COLOR], stackpos = [COLOR="DarkGreen"]1[/COLOR] },
		{ x = [COLOR="DarkGreen"]30002[/COLOR], y = [COLOR="DarkGreen"]30000[/COLOR], z = [COLOR="DarkGreen"]7[/COLOR], stackpos = [COLOR="DarkGreen"]1[/COLOR] },
		{ x = [COLOR="DarkGreen"]30003[/COLOR], y = [COLOR="DarkGreen"]30000[/COLOR], z = [COLOR="DarkGreen"]7[/COLOR], stackpos = [COLOR="DarkGreen"]1[/COLOR] }
	}
}

if item.uid == config.uniqueid and item.itemid == config.tile and setPlayerStorageValue(cid,[COLOR="DarkGreen"]15000[/COLOR],[COLOR="DarkGreen"]1[/COLOR]) [COLOR="DarkGreen"]== TRUE[/COLOR] then
	for i = 1, table.maxn(config.spawn) do
         doCreatureSay(cid, "TEXT_TEXT.", TALKTYPE_ORANGE_1)
		 doSummonCreature(config.monster, config.spawn[i])
else
         doPlayerSendCancel(cid, "TEXT_TEXT.")
		 	end
		return TRUE
	end
end[/COLOR]
 
Try this =D!

Code:
[COLOR="Blue"]function onStepIn(cid, item, frompos, item2, topos)
local config = {
	tile = [COLOR="DarkGreen"]407[/COLOR],
	uniqueid = [COLOR="DarkGreen"]3000[/COLOR],
	monster = [COLOR="DarkGreen"]"Demon"[/COLOR],
	spawn = {
		{ x = [COLOR="DarkGreen"]30000[/COLOR], y = [COLOR="DarkGreen"]30000[/COLOR], z = [COLOR="DarkGreen"]7[/COLOR], stackpos = [COLOR="DarkGreen"]1[/COLOR] },
		{ x = [COLOR="DarkGreen"]30001[/COLOR], y = [COLOR="DarkGreen"]30000[/COLOR], z = [COLOR="DarkGreen"]7[/COLOR], stackpos = [COLOR="DarkGreen"]1[/COLOR] },
		{ x = [COLOR="DarkGreen"]30002[/COLOR], y = [COLOR="DarkGreen"]30000[/COLOR], z = [COLOR="DarkGreen"]7[/COLOR], stackpos = [COLOR="DarkGreen"]1[/COLOR] },
		{ x = [COLOR="DarkGreen"]30003[/COLOR], y = [COLOR="DarkGreen"]30000[/COLOR], z = [COLOR="DarkGreen"]7[/COLOR], stackpos = [COLOR="DarkGreen"]1[/COLOR] }
	}
}

if item.uid == config.uniqueid and item.itemid == config.tile and setPlayerStorageValue(cid,[COLOR="DarkGreen"]15000[/COLOR],[COLOR="DarkGreen"]1[/COLOR]) [COLOR="DarkGreen"]== TRUE[/COLOR] then
	for i = 1, table.maxn(config.spawn) do
         doCreatureSay(cid, "TEXT_TEXT.", TALKTYPE_ORANGE_1)
		 doSummonCreature(config.monster, config.spawn[i])
else
         doPlayerSendCancel(cid, "TEXT_TEXT.")
		 	end
		return TRUE
	end
end[/COLOR]

thanks...!


Edit: Darkhaos, if i want other creature's to spawn how i do ? ;)
Also it spawning again after 10 secs ;)...
 
Last edited:
Here is ;)

Code:
function onStepIn(cid, item, frompos, item2, topos)
local config = {
	time = [COLOR="Blue"]10[/COLOR], --in seconds
	tile = [COLOR="Blue"]407[/COLOR],
	uniqueid = [COLOR="Blue"]3000[/COLOR],
	monster = {
	"[COLOR="Blue"]Demon[/COLOR]",
	"[COLOR="Blue"]Dark Torturer[/COLOR]",
	"[COLOR="Blue"]Los Soul[/COLOR]"
},
	spawn = {
		{ x = [COLOR="Blue"]30000[/COLOR], y = [COLOR="Blue"]30000[/COLOR], z = [COLOR="Blue"]7[/COLOR], stackpos = [COLOR="Blue"]1[/COLOR] },
		{ x = [COLOR="Blue"]30001[/COLOR], y = [COLOR="Blue"]30000[/COLOR], z = [COLOR="Blue"]7[/COLOR], stackpos = [COLOR="Blue"]1[/COLOR] },
		{ x = [COLOR="Blue"]30002[/COLOR], y = [COLOR="Blue"]30000[/COLOR], z = [COLOR="Blue"]7[/COLOR], stackpos = [COLOR="Blue"]1[/COLOR] },
		{ x = [COLOR="Blue"]30003[/COLOR], y = [COLOR="Blue"]30000[/COLOR], z = [COLOR="Blue"]7[/COLOR], stackpos = [COLOR="Blue"]1[/COLOR] }
	}
}

if item.uid == config.uniqueid and item.itemid == config.tile and setPlayerStorageValue(cid,[COLOR="Blue"]15000[/COLOR],[COLOR="Blue"]1[/COLOR]) == TRUE then
	for i = 1, table.maxn(config.spawn) do
	for k = 1, table.maxn(config.monster) do
         doCreatureSay(cid, "[COLOR="Blue"]TEXT_TEXT.[/COLOR]", TALKTYPE_ORANGE_1)
		doSummonCreature(config.monster[k], config.spawn[i])
		addEvent(reSpawn, config.time * 1000, config.spawn[i])
else
         doPlayerSendCancel(cid, "[COLOR="Blue"]TEXT_TEXT.[/COLOR]")

		 		end
			return TRUE
		end
	end 
end


function reSpawn()

local configReSpawn = {
	monster = {
	"[COLOR="Blue"]Demon[/COLOR]",
	"[COLOR="Blue"]Dark Torturer[/COLOR]",
	"[COLOR="Blue"]Los Soul[/COLOR]"
},
	spawn = {
		{ x = [COLOR="Blue"]30000[/COLOR], y = [COLOR="Blue"]30000[/COLOR], z = [COLOR="Blue"]7[/COLOR], stackpos = [COLOR="Blue"]1[/COLOR] },
		{ x = [COLOR="Blue"]30001[/COLOR], y = [COLOR="Blue"]30000[/COLOR], z = [COLOR="Blue"]7[/COLOR], stackpos = [COLOR="Blue"]1[/COLOR] },
		{ x = [COLOR="Blue"]30002[/COLOR], y = [COLOR="Blue"]30000[/COLOR], z = [COLOR="Blue"]7[/COLOR], stackpos = [COLOR="Blue"]1[/COLOR] },
		{ x = [COLOR="Blue"]30003[/COLOR], y = [COLOR="Blue"]30000[/COLOR], z = [COLOR="Blue"]7[/COLOR], stackpos = [COLOR="Blue"]1[/COLOR] }
	}
}
	for i = 1, table.maxn(configReSpawn.spawn) do
	for k = 1, table.maxn(configReSpawn.monster) do
		doSummonCreature(configReSpawn.monster[k], configReSpawn.spawn[i])

		end
	end
end

I don't know if this works... try and post here if it works or not =)
 
Here is ;)

Code:
function onStepIn(cid, item, frompos, item2, topos)
local config = {
	time = [COLOR="Blue"]10[/COLOR], --in seconds
	tile = [COLOR="Blue"]407[/COLOR],
	uniqueid = [COLOR="Blue"]3000[/COLOR],
	monster = {
	"[COLOR="Blue"]Demon[/COLOR]",
	"[COLOR="Blue"]Dark Torturer[/COLOR]",
	"[COLOR="Blue"]Los Soul[/COLOR]"
},
	spawn = {
		{ x = [COLOR="Blue"]30000[/COLOR], y = [COLOR="Blue"]30000[/COLOR], z = [COLOR="Blue"]7[/COLOR], stackpos = [COLOR="Blue"]1[/COLOR] },
		{ x = [COLOR="Blue"]30001[/COLOR], y = [COLOR="Blue"]30000[/COLOR], z = [COLOR="Blue"]7[/COLOR], stackpos = [COLOR="Blue"]1[/COLOR] },
		{ x = [COLOR="Blue"]30002[/COLOR], y = [COLOR="Blue"]30000[/COLOR], z = [COLOR="Blue"]7[/COLOR], stackpos = [COLOR="Blue"]1[/COLOR] },
		{ x = [COLOR="Blue"]30003[/COLOR], y = [COLOR="Blue"]30000[/COLOR], z = [COLOR="Blue"]7[/COLOR], stackpos = [COLOR="Blue"]1[/COLOR] }
	}
}

if item.uid == config.uniqueid and item.itemid == config.tile and setPlayerStorageValue(cid,[COLOR="Blue"]15000[/COLOR],[COLOR="Blue"]1[/COLOR]) == TRUE then
	for i = 1, table.maxn(config.spawn) do
	for k = 1, table.maxn(config.monster) do
         doCreatureSay(cid, "[COLOR="Blue"]TEXT_TEXT.[/COLOR]", TALKTYPE_ORANGE_1)
		doSummonCreature(config.monster[k], config.spawn[i])
		addEvent(reSpawn, config.time * 1000, config.spawn[i])
else
         doPlayerSendCancel(cid, "[COLOR="Blue"]TEXT_TEXT.[/COLOR]")

		 		end
			return TRUE
		end
	end 
end


function reSpawn()

local configReSpawn = {
	monster = {
	"[COLOR="Blue"]Demon[/COLOR]",
	"[COLOR="Blue"]Dark Torturer[/COLOR]",
	"[COLOR="Blue"]Los Soul[/COLOR]"
},
	spawn = {
		{ x = [COLOR="Blue"]30000[/COLOR], y = [COLOR="Blue"]30000[/COLOR], z = [COLOR="Blue"]7[/COLOR], stackpos = [COLOR="Blue"]1[/COLOR] },
		{ x = [COLOR="Blue"]30001[/COLOR], y = [COLOR="Blue"]30000[/COLOR], z = [COLOR="Blue"]7[/COLOR], stackpos = [COLOR="Blue"]1[/COLOR] },
		{ x = [COLOR="Blue"]30002[/COLOR], y = [COLOR="Blue"]30000[/COLOR], z = [COLOR="Blue"]7[/COLOR], stackpos = [COLOR="Blue"]1[/COLOR] },
		{ x = [COLOR="Blue"]30003[/COLOR], y = [COLOR="Blue"]30000[/COLOR], z = [COLOR="Blue"]7[/COLOR], stackpos = [COLOR="Blue"]1[/COLOR] }
	}
}
	for i = 1, table.maxn(configReSpawn.spawn) do
	for k = 1, table.maxn(configReSpawn.monster) do
		doSummonCreature(configReSpawn.monster[k], configReSpawn.spawn[i])

		end
	end
end

I don't know if this works... try and post here if it works or not =)


I'll try but one problem, where does dark torurer and they spawn ? same pos like demon ?

its work 2 monster in 1 sqm ?D:
 
Not working

Code:
function onStepIn(cid, item, frompos, item2, topos)
local config = {
	tile = 103,
	uniqueid = 3000,
	monster = "Morgaroth",
	spawn = {
		{ x = 1328, y = 1143, z = 7, stackpos = 1 },
		{ x = 1000, y = 1000, z = 6, stackpos = 1 },
		{ x = 1001, y = 1000, z = 6, stackpos = 1 },
		{ x = 1002, y = 1000, z = 6, stackpos = 1 }
	}
}

if item.uid == config.uniqueid and item.itemid == config.tile and setPlayerStorageValue(cid,15000,1) == TRUE then
	for i = 1, table.maxn(config.spawn) do
         doCreatureSay(cid, "You are going to die!", TALKTYPE_ORANGE_1)
		 doSummonCreature(config.monster, config.spawn[i])
else
         doPlayerSendCancel(cid, "Grrrr.")
		 	end
		return TRUE
	end
end

This is what I used..

This is the errors I get:

LuaSetCombatCondition<>. Combat not found
Warning: [Event::loadScript] Can not load script. data/movements/scripts/summonscript.lua
data/movements/scripts/summonscript.lua:18: 'end' expected <to close 'for' at line 15
near 'else'
 
Use this

PHP:
local config = {
	tile = 103,
	uniqueid = 3000,
	monster = "Morgaroth",
	spawn = {
		{ x = 1328, y = 1143, z = 7, stackpos = 1 },
		{ x = 1000, y = 1000, z = 6, stackpos = 1 },
		{ x = 1001, y = 1000, z = 6, stackpos = 1 },
		{ x = 1002, y = 1000, z = 6, stackpos = 1 }
	}
}

function onStepIn(cid, item, frompos, item2, topos)
	if item.uid == config.uniqueid and item.itemid == config.tile and setPlayerStorageValue(cid,15000,1) == TRUE then
		for i = 1, table.maxn(config.spawn) do
			doCreatureSay(cid, "You are going to die!", TALKTYPE_ORANGE_1)
			doSummonCreature(config.monster, config.spawn[i])
		end
	else
        doPlayerSendCancel(cid, "Grrrr.")
	end
	return TRUE
end
 
for mixed monsters:
PHP:
local config = {
    tile = 103,
    uniqueid = 3000,
    ["spawn"] = {
        { x = 1328, y = 1143, z = 7, stackpos = 1, monster="demon" },
        { x = 1000, y = 1000, z = 6, stackpos = 1, monster="Orshabaal" },
        { x = 1001, y = 1000, z = 6, stackpos = 1, monster="Hellgorak" },
        { x = 1002, y = 1000, z = 6, stackpos = 1, monster="Morgaroth" }
    }
}

function onStepIn(cid, item, frompos, item2, topos)
    if item.uid == config.uniqueid and item.itemid == config.tile and setPlayerStorageValue(cid,15000,1) == TRUE then
        for i = 1, table.maxn(config["spawn"]) do
            doCreatureSay(cid, "You are going to die!", TALKTYPE_ORANGE_1)
            doSummonCreature(config["spawn"][i].monster, config["spawn"][i])
        end
    else
        doPlayerSendCancel(cid, "Grrrr.")
    end
    return TRUE
end
 
I'm really noobish. I'm making my own LUA script that'll summon when I enter a certain XYZ, But what to write in "movements.xml" ?

<movevent event="StepIn" script="stepspawn.lua"/>

That's what I use ATM.

PS. TFS 0.2
 
Code:
<movevent event="StepIn" uniqueid="1234" script="stepspawn.lua"/>
or
Code:
<movevent event="StepIn" actionid="1234" script="stepspawn.lua"/>
 
for mixed monsters:
PHP:
local config = {
    tile = 103,
    uniqueid = 3000,
    ["spawn"] = {
        { x = 1328, y = 1143, z = 7, stackpos = 1, monster="demon" },
        { x = 1000, y = 1000, z = 6, stackpos = 1, monster="Orshabaal" },
        { x = 1001, y = 1000, z = 6, stackpos = 1, monster="Hellgorak" },
        { x = 1002, y = 1000, z = 6, stackpos = 1, monster="Morgaroth" }
    }
}

function onStepIn(cid, item, frompos, item2, topos)
    if item.uid == config.uniqueid and item.itemid == config.tile and setPlayerStorageValue(cid,15000,1) == TRUE then
        for i = 1, table.maxn(config["spawn"]) do
            doCreatureSay(cid, "You are going to die!", TALKTYPE_ORANGE_1)
            doSummonCreature(config["spawn"][i].monster, config["spawn"][i])
        end
    else
        doPlayerSendCancel(cid, "Grrrr.")
    end
    return TRUE
end

For this I need to use:

<movevent event="StepIn" itemid="103" script="spawnscript.lua"/>

right? I tried through actions also (not at the same time ofc) since there is:

<action uniqueid="3000" script="other/spawnscript.lua"/>

but well noone works, can someone help me :S

btw I've been looking for a working stepIn script for like a week, I even tried making my own through a tutorial, didn't succeed though :( plx halp :)
 
iam using this
Code:
<movevent type="StepIn" uniqueid="3000" event="script" value="12masters/Master1.lua"/>

1 question though the player can keep walking on the sqm and it summons the mob over and over?

how can i make it so it wil only sumon it 1 time

i have this as my code..

Code:
local config = {
    tile = 426,
	uniqueid= 3000,
    monster = "Energy Master",
    spawn = {
        { x = 242, y = 73, z = 10, stackpos = 1 }
    }
}

function onStepIn(cid, item, frompos, item2, topos)
    if item.uid == config.uniqueid and item.itemid == config.tile and setPlayerStorageValue(cid,15000,1) == TRUE then
        for i = 1, table.maxn(config.spawn) do
            doCreatureSay(cid, "You are going to die!", TALKTYPE_ORANGE_1)
            doSummonCreature(config.monster, config.spawn[i])
        end
    else
        doPlayerSendCancel(cid, "Grrrr.")
	end
    return TRUE
end
 
Set a storagevalue.

I.e.

LUA:
local config = {
    tile = 426,
	uniqueid= 3000,
    monster = "Energy Master",
    spawn = {
        { x = 242, y = 73, z = 10, stackpos = 1 }
    }
}

function onStepIn(cid, item, frompos, item2, topos)
    if item.uid == config.uniqueid and item.itemid == config.tile and setPlayerStorageValue(cid,15000,1) == TRUE and getPlayerStorageValue(cid,1000) < 1 then
        for i = 1, table.maxn(config.spawn) do
            doCreatureSay(cid, "You are going to die!", TALKTYPE_ORANGE_1)
            doSummonCreature(config.monster, config.spawn[i])
        end
        setPlayerStorageValue(cid,1000,1)
    else
        doPlayerSendCancel(cid, "Grrrr.")
	end
    return TRUE
end
 
Back
Top