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

Solved Need help with doCreateMonster function !

Materion

New Member
Joined
Feb 18, 2012
Messages
81
Reaction score
2
Hello I'm using tfs 0.4.1 and I wanna make a simple script - when i click on a lamp it gonna create a dragon near character. Script looks like
Lua:
function onUse(cid, item, frompos, item2, topos)
	if(item.itemid == 2344) then
		doCreateMonster(cid,"Dragon")
	end
	return true
end

When I'm using this script nothing happens and on server console i got error message : (luaDoCreateMonster) Monster with name '268436457' not found.

I tried write like this:
doCreateMonster(cid,Dragon)
doCreateMonster(cid,'Dragon')
swapping cid with dragon parameter - nothing helps. What im doing wrong ? It's such a simple function and i have problems with using it ;/.

P.S
When im using function : doSummonMonster(cid,"Dragon") it works, but with doCreateMonster(cid,"Dragon") don't ... I have no idea what's wrong ;s
 
Last edited:
You clearly doesnt know how doCreateMonster works.... But hey Im here to help :)

doCreateMonster is asking for two things, a string (monsters name) and a vector (where it should spawn aka position of it).

So now we have the function like this, doCreateMonster(string, vector).

If you want to make a dragon appear next to you, then you could do something like this,
Lua:
function onUse(cid, item, frompos, item2, topos)
	if(item.itemid == 2344) then
		local YourPos = getPlayerPosition(cid)

                doCreateMonster("Dragon", {x = YourPos.x + 1, y = YourPos.y + 1, YourPos.z})
	end
	return true
end

Hope this helped you, the code is not tested and it was like 3 years I coded in TibiaLua....
 
next time look at evil hero's post or at docs there you will find function(whatfirst,whatsecond,whatthird) hope you understand
 
Back
Top