• 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 resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

CreatureEvent Monster Clone!

Printer

if Printer then print("LUA") end
Senator
Premium User
Joined
Dec 27, 2009
Messages
5,782
Solutions
31
Reaction score
2,286
Location
Sweden?
Hello,

I was bored today so i made a script, i haven't tested but should work for 0.3:
CreatureScript/creaturescripts.xml
XML:
<event type="attack" name="Clone" event="script" value="clone.lua"/>

Creaturescript/scripts and name the lua "clone.lua" and paste code below:
Lua:
local change_name = false --Only if you have the function!

function onAttack(cid, target)
	if (isCreature(target)) then
		if (getCreatureStorage(cid, getCreatureName(target)) < 1) then
			doCreatureSetStorage(cid, getCreatureName(target), 1)
			doSetCreatureOutfit(cid, getCreatureOutfit(target), -1)
			setCreatureMaxHealth(cid,getCreatureHealth(target))
			doCreatureAddHealth(cid,getCreatureHealth(target))
			if (change_name) then
				setCreatureName(cid, ""..getCreatureName(target).."", "a clone") 
			end
		end
	end
	return true
end

Now create new monster and just register this tag to it:
XML:
<script>
<event name="Clone"/>
</script>

Simply the script does, is the monster copy the target outfit, hp and name is optional.

Any other suggestions i can add to it, just comment.

If you want it to change the name to the target you can set true but you need also install this by Scarlet:
http://otland.net/f35/change-existing-monster-name-game-131643/

Enjoy!
 
No problem, any suggestions just comment ^^
 
[24/08/2013 23:29:58] [Error - CreatureEvent::configureEvent] No valid type for creature event.attack
[24/08/2013 23:29:58] Warning: [BaseEvents::loadFromXml] Can not configure event

I also get [25/08/2013 00:16:01] Warning: [Monster::Monster]. Unknown event name - clone
When I try to change the parameters to something working, i.e. from attack to death.


Not sure what the deal is here, probably that I'm on mystic spirit and lacking 200 features. Lol. Doing some research but thought I'd post here anyway.


EDIT:

From what I can tell I can't make an event called attack for some reason and even if the event is valid it still doesn't find the script. Google and searching yield nothing.
 
Last edited:
Back
Top