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

Need script on my noobwar

Gkatt

New Member
Joined
Mar 24, 2009
Messages
413
Reaction score
4
Need a script that level 20 and higher cant kill level 13's until the level 13's is level 16

Thanks
:thumbup:
 
Lua:
function onCombat(cid, target)
	if isPlayer(cid) and isPlayer(target) then
		if getPlayerLevel(cid) >= 20 and getPlayerLevel(target) < 16 then
			doPlayerSendCancel(cidm 'You can not attack players below level 16')
			return false
		end
	end
	return true
end
Lua:
registerCreatureEvent(cid, "prot")
XML:
<event type="combat" name="prot" event="script" value="prot.lua"/>
 
thanks can u tell me where to put this, and 1 more thing is it player above level 20s that cant kill 13s or just level 20s?
 
It works but i have a problem that is annoying me much


[18/11/2010 18:44:00] [Error - CreatureScript Interface]
[18/11/2010 18:44:00] data/creaturescripts/scripts/prot.lua:eek:nCombat
[18/11/2010 18:44:00] Description:
[18/11/2010 18:44:00] data/creaturescripts/scripts/prot.lua:4: attempt to call global 'cidm' (a nil value)
[18/11/2010 18:44:00] stack traceback:
[18/11/2010 18:44:00] data/creaturescripts/scripts/prot.lua:4: in function <data/creaturescripts/scripts/prot.lua:1>


+ 1 more problem

People under level 13 can attack the 20s but they cant attack back lol ;s
 
It works but i have a problem that is annoying me much





+ 1 more problem

People under level 13 can attack the 20s but they cant attack back lol ;s
I put a m instead of comma
Lua:
function onCombat(cid, target)
    if isPlayer(cid) and isPlayer(target) then
        if getPlayerLevel(cid) >= 20 and getPlayerLevel(target) < 16 then
            doPlayerSendCancel(cid, 'You can not attack players below level 16')
            return false
        elseif getPlayerLevel(cid) < 16 and getPlayerLevel(target) >= 20 then
            doPlayerSendCancel(cid, 'You can not attack players above level 20')
            return false
        end
    end
    return true
end
 
Back
Top