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

How do I use removeCriature?

mikeware

New Member
Joined
Jul 17, 2007
Messages
338
Reaction score
0
Location
Brazil
How do I remove a criature using doRemoveCriature(cid)?
Im trying some ways but keep saying creature not found etc... Here is what im trying:
Code:
function onThink()
donotSummon = 0

	if (START == TRUE) then
		if os.difftime (os.time(), osTime) == (2) then
			if getCreaturePosition(cid) == {x=114,y=503,z=8} then
			doRemoveCreature(cid)
			end
		end
	end
end
thanks
 
this is what im using for my battle arena script, doRemoveCreature(arenacreature.uid) about your script.. well you dont have a cid value declared anywhere so thats probably the problem

i found this in the sources uint32_t CreatureEvents:: playerThink(Player* player, uint32_t interval) so that basicly meens you would have to declare the onThink function as onThink(cid, TIME) and it cant be used on monsters like that.. you would have to find the monster at the position where its supposed to be
 
Last edited:
not like that lol, example of doRemoveCreature()

kickme.lua
Code:
function onSay(cid, words, param)
    if words == "/kickme" then
        doRemoveCreature(cid)
    end
end

THIS IS ONLY AN EXAMPLE CODE!! DONT USE IT!!

but in your code you got it all wrong, i just hope Talaturen can fix this for you, cuz i cant since i really does not know what this script has to do.

doRemoveCreature does only have 1 parameter you have to set wich is uid, uid = Player, creature, item's UNIQUE ID the ways to find a unique id:
Code:
cpos = {x=100, y=100, z=7, stackpos=[B][U]253[/U][/B]} [B][U]253 = player and creature position[/U][/B]
creature = getThingfromPos([B][U]cpos[/U][/B]) [B][U]this find the player/creature at the given position, and then you can use creature.uid to find the creatures unique id[/U][/B]

itempos = {x=100, y=100, z=7, stackpos=[B][U]anything from 0-252[/U][/B]}
item = getThingfromPos([B][U]itempos[/U][/B]) [B][U]this finds the item from the position, then you can use item.uid to find the unique id[/U][/B]

function onUse(item, BLABLABLALBAL) [B][U]here you have the item already, so the items unique id is item.uid[/U][/B]
 
Last edited:
Like this?
Code:
function onThink()

	if (START == TRUE) then
		if os.difftime (os.time(), osTime) == (0) then
			cpos = {x=114, y=503, z=8, stackpos=253}
			creature = getThingfromPos(cpos)
			doRemoveCreature(creature)
		end
	end
end
 
Like this?
Code:
function onThink()

	if (START == TRUE) then
		if os.difftime (os.time(), osTime) == (0) then
			cpos = {x=114, y=503, z=8, stackpos=253}
			creature = getThingfromPos(cpos)
			doRemoveCreature(creature)
		end
	end
end

ok anyway, I tried this and don't worked too =(
 
Back
Top