• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Closed!

Status
Not open for further replies.

Printer

if Printer then print("LUA") end
Senator
Premium User
Joined
Dec 27, 2009
Messages
5,780
Solutions
31
Reaction score
2,299
Location
Sweden?
Solved by the awsome J.Dre

Thank you very much bro!
 
Last edited:
I dont need even party to attack his pokemon :/

and also i get this error:

Code:
[06/05/2012 15:49:37] [Error - CreatureScript Interface] 
[06/05/2012 15:49:37] data/creaturescripts/scripts/playerattack.lua:onTarget
[06/05/2012 15:49:37] Description: 
[06/05/2012 15:49:37] (luaGetPlayerParty) Player not found

[06/05/2012 15:49:47] [Error - CreatureScript Interface] 
[06/05/2012 15:49:47] data/creaturescripts/scripts/playerattack.lua:onTarget
[06/05/2012 15:49:47] Description: 
[06/05/2012 15:49:47] (luaGetPlayerParty) Player not found

I going to explain, this first script i paste its working 100% but problem is i want put a code inside that script which making it possible to attack another pokemon without having party, but you need storage 5701 to attack someones pokemon if you not got that storage it will come the cancel text: You have to join a party to duel

Still same i can attack his monster without the storage :(
 
Last edited by a moderator:
No im not in party :(

I should be able attack when im in party and also when i have this storage.

But i dont have any party or storage i can still attack :/
 
No im not in party :(

I should be able attack when im in party and also when i have this storage.

But i dont have any party or storage i can still attack :/

Does the message show up? Sometimes the "red square" will appear, but you can't do any damage to them (it's working).
 
Nop the message dont appear, and i get red square so i can still damage with hand and spells.
 
This works, I tested it. ^_^

login.lua
LUA:
registerCreatureEvent(cid, "Duel")
creaturescripts.xml
XML:
<event type="target" name="Duel" event="script" value="duel.lua" />
duel.lua
LUA:
local storage = 5701
function onTarget(cid, target)
	if(isSummon(target)) then
	
		local master = getCreatureMaster(target)
		if(master and master == target) then return true end
		
		if(master and master ~= target) then
			if(not isInParty(cid) and not isInParty(master)) then
				if(getCreatureStorage(cid, storage) > 0) then
					return true
				else
					doPlayerSendCancel(cid, "You must be in a party to duel.")
					return false
				end
			elseif(getPlayerParty(cid) ~= getPlayerParty(master)) then
				if(getCreatureStorage(cid, storage) > 0) then
					return true
				else
					doPlayerSendCancel(cid, "You must be in the same party to duel.")
					return false
				end
			end
		end
	end
	return true
end
 
Last edited:
Ok the party works, but the storage thing dont work :/ it says i need in duel when i got the storage
 
Im truely sorry bro :(

The storage now working awesome :D! so i tested the party that didnt work :(

Your doing nice job :D Almost Done!

P.S Thank you for helping :D
 
Worked 100% Thank you very very very very very 100000x much bro :D

Rep!
 
Status
Not open for further replies.
Back
Top