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

Summon Scroll

Scorpvm 101

Active Member
Joined
Feb 23, 2010
Messages
460
Solutions
3
Reaction score
28
Location
Spain
Hello guys of otland!

I want one scroll when one guy use this scroll are summon one demon..

I have this scripts buy dont function :S.

Code:
function onUse(cid, item, frompos, item2, topos)
pos = getPlayerPosition(cid)
if getTilePzInfo(topos) == 0 then
if getTilePzInfo(pos) == 0 then
if item.itemid == 2140 then
doTransformItem(item.uid,2016)
doSummonCreature("VIP", pos)
doSendMagicEffect(topos,12)
doPlayerSay(cid,"Sale Vip",1)
doRemoveItem(item.uid,item.type)
else
doPlayerSendCancel(cid,"You cannot use that.")
end
else
doPlayerSendCancel(cid,"You can't use this scroll in pz zone.")
end
else
doPlayerSendCancel(cid,"You can't use this scroll in pz zone.")
end
return 1
end
 
replace getPlayerPosition to getCreaturePosition
doSummonCreature("VIP",pos) <-- the monster's named VIP? I thought it was a demon
also it would just summon the creature and not give ownership to the player

also, as a side note... please learn how to indent your coding, horrible to read
 
explain more of what you want here, cause like tosuxo said u have vip as creature when u say u want demon, and do u want this demon to follow you and attack what u attack or what?
 
Since I don't know what you want I just rewrote it so it is able to read it..
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.itemid ~= 2140 then
		return doPlayerSendCancel(cid,"You cannot use that.")
	end
	if getTilePzInfo(getThingPos(cid)) == 0 or getTilePzInfo(toPosition) == 0 then
		return doPlayerSendCancel(cid,"You can't use this scroll in pz zone.")
	end

	doSummonCreature("VIP", getClosestFreeTile(cid,  getThingPos(cid)))
	doSendMagicEffect(toPosition,12)
	doPlayerSay(cid,"Sale Vip")
	doRemoveItem(item.uid)

	return true
end
 
Last edited:
"if getTilePzInfo(getThingPos(cid)) ~= 0"
doesn't that mean IsNOT =
surely if it's not 0 then it's a pz, therefore you "cant use this in a pz" but if you use out of a pz it'll say you can't use in a pz... or something

also:
Code:
if item.itemid ~= 2140 then
	return doPlayerSendCancel(cid,"You cannot use that.")
end
surely in actions.xml you set the item number to execute the script? no need for this bit at all

the summoned demon "VIP" will be a regular monster and not under control of the scroll user?
you'll need to convince the summoned monster, check out the pokémon scripts for how to do that
 
@pz
my bad

@itemid
read my post above, I don't care about the thread starter posting senseless scripts, I just made it clearer

Also, the dvse should maybe write something because no one knows what he does.
Convincing a demon won't work by doConvinceCreature() at all since Demon isn't convincable you would need to create a custom demon which is convinceable or do a source edit.
 
Back
Top