MoveEvent Creaturescript Arena

ond

Veteran OT User
Joined
Mar 24, 2008
Messages
2,700
Best answers
22
Reaction score
414
Location
Sweden
[Server used = Theforgotten server 0.2.7 Client 8.0]

Hello, I was looking for some help with a creaturescript to my server which is supposed to be to Svargrond arena.

Anyway, here is the script

function onKill(cid, target)
local monster = getCreatureName(target)
local room = getArenaMonsterIdByName(monster)
if room > 0 then
setPlayerStorageValue(cid, room, 1)
doPlayerSendTextMessage(cid,MESSAGE_EVENT_DEFAULT,'Mozesz wejsc do kolejnego pokoju areny!')
end
end
And here is the console error:

[02/06/2009 17:55:01] Error: [CreatureEvent::configureEvent] No valid type for creature event.kill
[02/06/2009 17:55:01] Warning: [BaseEvents::loadFromXml] Can not configure event
If anyone knows what the problem might be, please post it here or send me a private message.

Thanks.
 

Shawak

Intermediate OT User
Joined
Sep 11, 2008
Messages
1,976
Best answers
2
Reaction score
101
Location
Germany
Lua:
function onKill(cid, target)
	local text = 'Mozesz wejsc do kolejnego pokoju areny!'

	local monster = getCreatureName(target)
	local room = getArenaMonsterIdByName(monster)
	if room > 0 then
		setPlayerStorageValue(cid, room, 1)
		doPlayerSendTextMessage(cid,MESSAGE_EVENT_DEFAULT, text)
	end
	return TRUE
end
Regards,
Shawak
 
OP
ond

ond

Veteran OT User
Joined
Mar 24, 2008
Messages
2,700
Best answers
22
Reaction score
414
Location
Sweden
Thanks, but it didn't work. I figure it might have to to with
local monster = getCreatureName(target)
local room = getArenaMonsterIdByName(monster)
But since I don't know sh*t 'bout it, I've got no clue how to fix it:(
 
OP
ond

ond

Veteran OT User
Joined
Mar 24, 2008
Messages
2,700
Best answers
22
Reaction score
414
Location
Sweden
I don't think I've got the function "onKILL"
 

Shawak

Intermediate OT User
Joined
Sep 11, 2008
Messages
1,976
Best answers
2
Reaction score
101
Location
Germany
data/creaturescripts/creaturescripts.xml
Add before the "</creaturescripts>"
Lua:
	<event type="kill" name="MonsterKill" event="script" value="kill.lua"/>
After that, goto data/creaturescripts/scripts and create kill.lua

Lua:
function onKill(cid, target)
        local text = 'Mozesz wejsc do kolejnego pokoju areny!'
        
        local monster = getCreatureName(target)
        local room = getArenaMonsterIdByName(monster)

        if room > 0 then
                setPlayerStorageValue(cid, room, 1)
                doPlayerSendTextMessage(cid,MESSAGE_EVENT_DEFAULT, text)
        end
        return TRUE
end
Regards,
Shawak
 
Last edited:
OP
ond

ond

Veteran OT User
Joined
Mar 24, 2008
Messages
2,700
Best answers
22
Reaction score
414
Location
Sweden
Thanks alot for helping but it still doesn't work haha, or perhaps... I'm not sure what you mean with
Add before the "</creaturescripts>"
I'll work on it

Thanks

Nevermind, I realized what you ment, haha. Well it didn't work:( Thanks anyway, if you figure it out, I'll be really thankfull. Thanks!
 
Last edited:
OP
ond

ond

Veteran OT User
Joined
Mar 24, 2008
Messages
2,700
Best answers
22
Reaction score
414
Location
Sweden
I was watching some other creaturescripts, some of them needs this in the monster files
<script>
<event name="Script"/>
</script>
 

Shawak

Intermediate OT User
Joined
Sep 11, 2008
Messages
1,976
Best answers
2
Reaction score
101
Location
Germany
I mean it so..
<?xml version="1.0" encoding="UTF-8"?>
<creaturescripts>
<event type="login" name="PlayerLogin" event="script" value="login.lua"/>
<event type="death" name="PlayerDeath" event="script" value="playerdeath.lua"/>
<event type="joinchannel" name="GuildMotd" event="script" value="guildmotd.lua"/>
<event type="kill" name="PlayerKill" event="script" value="kill.lua"/>
<event type="receivemail" name="Mail" event="script" value="mail.lua"/>
<event type="login" name="FirstItems" event="script" value="firstitems.lua"/>
<event type="kill" name="MonsterKill" event="script" value="kill.lua"/>
</creaturescripts>
I hope you understand it now.
 
OP
ond

ond

Veteran OT User
Joined
Mar 24, 2008
Messages
2,700
Best answers
22
Reaction score
414
Location
Sweden
Of course, and you should have alot of credits for helping, but unfortunately, it still doesn't seem to work. I get the same errors.
 

Shawak

Intermediate OT User
Joined
Sep 11, 2008
Messages
1,976
Best answers
2
Reaction score
101
Location
Germany
Post a screen with the error on the form.
Thanks.
 
OP
ond

ond

Veteran OT User
Joined
Mar 24, 2008
Messages
2,700
Best answers
22
Reaction score
414
Location
Sweden
Don't know why I can't upload a picture but I simply can't lol nothings happends

ImageShack
 

Shawak

Intermediate OT User
Joined
Sep 11, 2008
Messages
1,976
Best answers
2
Reaction score
101
Location
Germany
You changed the creaturescripts.xml?
 
OP
ond

ond

Veteran OT User
Joined
Mar 24, 2008
Messages
2,700
Best answers
22
Reaction score
414
Location
Sweden
You changed the creaturescripts.xml?
Yes, here is my creaturescript.xml:

<?xml version="1.0" encoding="UTF-8"?>
<creaturescripts>
<event type="login" name="PlayerLogin" script="login.lua"/>
<event type="logout" name="PlayerLogout" script="logout.lua"/>
<event type="death" name="PlayerDeath" script="playerdeath.lua"/>
<event type="login" name="FirstItems" script="firstitems.lua"/>
<event type="kill" name="MonsterKill" event="script" value="kill.lua"/>
</creaturescripts>
 

Shawak

Intermediate OT User
Joined
Sep 11, 2008
Messages
1,976
Best answers
2
Reaction score
101
Location
Germany
1. I don't know if the script work on 0.2.7

2. You have to write
Lua:
<?xml version="1.0" encoding="UTF-8"?>
<creaturescripts>
	<event type="login" name="PlayerLogin" script="login.lua"/>
	<event type="logout" name="PlayerLogout" script="logout.lua"/>
	<event type="death" name="PlayerDeath" script="playerdeath.lua"/>
	<event type="login" name="FirstItems" script="firstitems.lua"/>
	<event type="kill" name="MonsterKill" script="kill.lua"/>
</creaturescripts>
I forgot that you use TFS 0.2.7 ;)

Regards,
Shawak
 
OP
ond

ond

Veteran OT User
Joined
Mar 24, 2008
Messages
2,700
Best answers
22
Reaction score
414
Location
Sweden
Still doesn't work! :( The one who made this script (Geisor), said in his thread "Tested on theforgottenserver 0.2"
 

Shawak

Intermediate OT User
Joined
Sep 11, 2008
Messages
1,976
Best answers
2
Reaction score
101
Location
Germany
Then ask him ^_^.

Regards,
Shawak
 
OP
ond

ond

Veteran OT User
Joined
Mar 24, 2008
Messages
2,700
Best answers
22
Reaction score
414
Location
Sweden
Then ask him ^_^.
I have but I didn't get any answers. But I don't know why, because now I found another bug that is following: Even though I make Warlord Arena, frostfur spawns and alot of random stuff
 
OP
ond

ond

Veteran OT User
Joined
Mar 24, 2008
Messages
2,700
Best answers
22
Reaction score
414
Location
Sweden
Do I need to add
<script>
<event name="name of script">
</script>
In the monster files?
 
Top