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

This is not working

Singed

New Member
Joined
Apr 20, 2009
Messages
112
Solutions
1
Reaction score
2
I'm trying to make a script that when ever a player of lvl >= 500 kills a player lvl >= 500 the killer will get ### exp kinda like in pvpe, but only after lvl 500

Any ideas?
:peace:

Thanks, repp added where rep is earned.
 
Try this:

Put this in creaturescripts.xml :
Code:
<event type="kill" name="500kill" event="script" value="500kill.lua"/>
Then, make a lua script named "500kill" and put inside this:
Code:
function onKill(cid, target)
local reqlevel = 500
local exp = 50000

if isPlayer(target) == TRUE then
if getPlayerLevel(cid) and getPlayerLevel(target) >= reqlevel then
doPlayerAddExp(cid, exp)
end
end
return TRUE
end

And, don't forget to put:
Code:
registerCreatureEvent(cid, "500kill")
In login.lua, before the "return TRUE".

Note: If you have any problem, please tell me. I just made this script here, without testing it. xD

Note2: If you don't want to put it as a static gain exp, you can make a formula based on opponent's exp. If so, then change where it says "local exp = 50000" with your formula. For example:
Code:
local exp = getPlayerExperience(target)*.10
This will give the killer the 10% of the total exp of the player he just killed. Be creative x)
 
Its not working bro, when ever i try to run the server it gives me an error

Assertion Failed Error

any ideas?
 
Last edited:
Code:
local level = 500
local exp = 50000

function onKill(cid, target)
	if isPlayer(target) then
		if getPlayerLevel(cid) >= level and getPlayerLevel(target) >= level then
			doPlayerAddExperience(cid, exp)
		end
	end
return true
end
 
Code:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="hueheuhe" version="1.0" author="hsuasha" contact="in my house" enabled="yes">
	<event type="login" name="npcs" event="script"><![CDATA[
		registerCreatureEvent(cid, "killer")
		return true
	]]></event>
	<event type="kill" name="killer" event="script"><![CDATA[
		if isPlayer(cid) and isPlayer(target) then
			if getPlayerLevel(cid) >= 500 and getPlayerLevel(target) >= 500 then
				doPlayerAddExp(cid, 500)
			end
		end
		return true
	]]></event>
</mod>
 
Lua:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="hueheuhe" version="1.0" author="hsuasha" contact="in my house" enabled="yes">
	<event type="login" name="npcs" event="script"><![CDATA[
		registerCreatureEvent(cid, "killer")
		return true
	]]></event>
	<event type="kill" name="killer" event="script"><![CDATA[
		if isPlayer(cid) and isPlayer(target) then
			if getPlayerLevel(cid) >= 500 and getPlayerLevel(target) >= 500 then
				doPlayerAddExp(cid, 500)
			end
		end
		return true
	]]></event>
</mod>
Nothing is wrong in that script(OzIcO's script).
Just put the script in: ServerDirectory/mods/hueheuhe.xml
 
haha, sorry bro. And thanks :)

could you explain a little more on the mod folder? seems rather interesting :)
 
Back
Top