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

Pvp Sword Only

Magictibiaman

New Member
Joined
May 25, 2009
Messages
371
Reaction score
0
how do i make so a weapon can all be used to a player.

like for pvp, i want to use the avenger as a pvp sword, how would i do that
 
not really that complicated. ill see what i can do.

EDIT:

LUA:
--config--
local weapon = itemID
--end config--

	function onTarget(cid, target)
		if getPlayerSlotItem(cid, CONST_SLOT_LEFT) == weapon or getPlayerSlotItem(cid, CONST_SLOT_RIGHT) == weapon and isMonster(target) then
			return FALSE
		else 
			return TRUE	
	end
end

EDIT2: if ur a newb its a creature event. ask if u need help

Not tested...if it works. Rep++?
 
Last edited:
In:
/data/creaturescripts/scripts

Create file called:
pvpweapon.lua

Open file and copy code:
LUA:
--config--
local weapon = itemID
--end config--

	function onTarget(cid, target)
		if getPlayerSlotItem(cid, CONST_SLOT_LEFT) == weapon or getPlayerSlotItem(cid, CONST_SLOT_RIGHT) == weapon and isMonster(target) then
			return FALSE
		else 
			return TRUE	
	end
end

Open file called:

creaturescripts.xml

Paste this line into it:

Code:
	<event type="onTarget" name="PVPweapon" script="pvpweapon.lua"/>

Open file called:
login.lua

Paste this line into it appropriately:

Code:
registerCreatureEvent(cid, "DeathBroadcast")
 
Back
Top