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

talkaction : summoning script need help! >rep<

Jikoe II

Member
Joined
Feb 7, 2009
Messages
174
Reaction score
9
this is a working script that summons and deletes a dog

if somebody could add a minimum level to use this command and that it will cost 10 gold to summon the dog

thanx!

___/jikoe

script :


function doPlayerAddSummon(cid, name, pos)
local creature = doSummonCreature(name, pos)
doConvinceCreature(cid, creature)
return creature
end

function onSay(cid, words, param)
local petUid = 0
local pos = getCreaturePosition(cid)
local store = getPlayerStorageValue(cid, 1000)
if words == "!pet" then
if store == -1 then
if getTilePzInfo(pos) == FALSE then
petUid = doPlayerAddSummon(cid, "Dog", pos)
setPlayerStorageValue(cid, 1000, petUid)
else
doPlayerSendCancel(cid, "You can not call your pet in a protection zone.")
end
else
if isCreature(store) == TRUE then
doRemoveCreature(store)
setPlayerStorageValue(cid, 1000, 0)
else
if getTilePzInfo(pos) == FALSE then
petUid = doPlayerAddSummon(cid, "Dog", pos)
setPlayerStorageValue(cid, 1000, petUid)
else
doPlayerSendCancel(cid, "You can not call your pet in a protection zone.")
end
end
end
end
end
 
try this.

LUA:
local d = 'Dog'
function onSay(cid,words,param)
local v = getThingPos(cid)
	if not getCreatureSummons(cid) then
		if not getTilePzInfo(v) then
			doConvinceCreature(cid,d:lower())
			doSendMagicEffect(v,12)
			doPlayerSendTextMessage(cid,'You summoned a '..d..'.')
		else
			doPlayerSendCancel(cid,'Not allowed in PZ.')
			doSendMagicEffect(v,2)
		end
	else
		for _,c in ipairs(getCreatureSummons(cid)) do
			doSendMagicEffect(getThingPos(c),2)
			doRemoveCreature(c)
		end
		doPlayerSendTextMessage(cid,d..' is called back.')
	end
	return true
end
 
but still not a minimum level in the script and it doesnt take 10 gold from the player when used?

the script i posted was already working

but thanx for you help :)
 
Oops, sorry my bad, forgot xD.

Changed the script because I always rescript to my style.

anyways, here it is, enjoy.

LUA:
local d,l,g,m = 'Dog',10,10,'gold coin' -- change 'gold coin' to whatever coin you want.
function onSay(cid,words,param)
local v = getThingPos(cid)
    if not getCreatureSummons(cid) then
        if not getTilePzInfo(v) then
            if getPlayerLevel(cid) > l then
                if doPlayerRemoveItem(cid,getItemIdByName(m:lower()),g) then
                    doConvinceCreature(cid,d:lower())
                    doSendMagicEffect(v,12)
                    doPlayerSendTextMessage(cid,27,'You summoned a '..d..'.')
                else
                    doPlayerSendCancel(cid,'Not enough gold, need '..g..' gold.')
                    doSendMagicEffect(v,2)
                end
            else
            local n = l - getPlayerLevel(cid)
                doPlayerSendCancel(cid,'You need '..n..' levels more to summon this.')
                doSendMagicEffect(v,2)
            end
        else
            doPlayerSendCancel(cid,'Not allowed in PZ.')
            doSendMagicEffect(v,2)
        end
    else
        for _,c in ipairs(getCreatureSummons(cid)) do
            doSendMagicEffect(getThingPos(c),2)
            doRemoveCreature(c)
        end
        doPlayerSendTextMessage(cid,27,d..' is called back.')
    end
    return true
end
 
Last edited:
[15/10/2010 17:02:25] [Error - TalkAction Interface]
[15/10/2010 17:02:25] xxxxx:onSay
[15/10/2010 17:02:25] Description:
[15/10/2010 17:02:25] (luaDoPlayerSendTextMessage) Player not found
 
Sorry for errors, works 100% now.

LUA:
local d,l,g,m,s = 'Dog',10,10,'gold coin',13812 -- change 'gold coin' to whatever coin you want.
function onSay(cid,words,param)
local v = getThingPos(cid)
    if getPlayerStorageValue(cid,s) ~= 1 then
        if not getTilePzInfo(v) then
            if getPlayerLevel(cid) >= l then
                if doPlayerRemoveItem(cid,getItemIdByName(m:lower()),g) then
                    setPlayerStorageValue(cid,s,1)
                    doSummonMonster(cid,d:lower())
                    doSendMagicEffect(v,12)
                    doPlayerSendTextMessage(cid,27,'You summoned a '..d..'.')
                else
                    doPlayerSendCancel(cid,'Not enough gold, need '..g..' gold.')
                    doSendMagicEffect(v,2)
                end
            else
            local n = l - getPlayerLevel(cid)
                doPlayerSendCancel(cid,'You need '..n..' levels more to summon this.')
                doSendMagicEffect(v,2)
            end
        else
            doPlayerSendCancel(cid,'Not allowed in PZ.')
            doSendMagicEffect(v,2)
        end
    else
        for _,c in ipairs(getCreatureSummons(cid)) do
            doSendMagicEffect(getThingPos(c),2)
            doRemoveCreature(c)
        end
        setPlayerStorageValue(cid,s,0)
        doPlayerSendTextMessage(cid,27,d..' is called back.')
    end
    return true
end
 
Back
Top