• 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 [Many] My fully lua PET system (MANY FEATURES)

;~

Its not work. :/

Lua Script Error: [TalkAction Interface]
data/talkactions/scripts/pets/!pet.lua: onSay

data/talkactions/scripts/pets/!pet.lua:45: attempt to call global 'getCreatureBaseSpeed' (a nil value)
:: server save.. [done]

And too..
I use !pet And summoned and He atk mee!. :O

:cool:
HAHAHAHAHA


Help?
:wub:
 
found a bug

when u have your pet and give him 100 of something for example i gave my pet 100 throwing stars to hold and it gave me back a magic sword whenever its 100 of something changes the item it seems dose anyone know how to fix this?
 
When I attack a player or a monste with the pet, it just stands there and attacks only if the monster/player is beside it.. How do I make the pet to run to his foe and attack?
 
Its not work. :/



And too..
I use !pet And summoned and He atk mee!. :O

:cool:
HAHAHAHAHA


Help?
:wub:

Remember, you have to set "convinceable" value to 1, in your monster XML file.

when u have your pet and give him 100 of something for example i gave my pet 100 throwing stars to hold and it gave me back a magic sword whenever its 100 of something changes the item it seems dose anyone know how to fix this?

I think I know why this happens, I will post a fix if I have time.
EDIT: Here is the fix:
!petgetitem.lua:
PHP:
dofile("./petConfig.lua")
function onSay(cid, words, param)
	if isExhausted(cid) == 1 then
		return 0
	end
	local daPet = getPlayerStorageValue(cid, storages.petUid)
	if isCreature(daPet) == 1 then
		if param ~= "" then
			param = tonumber(param)
			if type(param) == "number" then
				if param <= maxItems then
					if getPlayerStorageValue(cid, petItems[param]) ~= 0 and getPlayerStorageValue(cid, petItems[param]) ~= -1 then
						local that = getPlayerStorageValue(cid, petItems[param])
						local item = math.floor(that/1000)
						local count = that-item*1000
						doPlayerAddItem(cid, item, count)
						if count == 1 then
							doCreatureSay(daPet, 'Here is your ' .. getItemName(item) .. '', TALKTYPE_ORANGE_1)
						else
							doCreatureSay(daPet, 'Here are your ' .. count .. ' ' .. getItemName(item) .. 's', TALKTYPE_ORANGE_1)
						end
						setPlayerStorageValue(cid, petItems[param], 0)
					end
				end
			end
		end
	end
return setExhausted(cid)
end
!petcarry.lua:
PHP:
dofile("./petConfig.lua")
function onSay(cid, words, param)

	if isExhausted(cid) == 1 then
		return 0
	end
	local mySto = 0
	local daPet = getPlayerStorageValue(cid, storages.petUid)
	if isCreature(daPet) == 1 then
		local pos = getCreaturePosition(daPet)
		local a = 1
		while a < 10 do
			if getItemWeight(getThingfromPos({x = pos.x, y = pos.y, z = pos.z, stackpos = a}).itemid, 1) ~= 0  then
				break
			end
			a = a + 1
		end
		local carryingItem = getThingfromPos({x = pos.x, y = pos.y, z = pos.z, stackpos = a})
		if getItemWeight(carryingItem.itemid, 1) ~= 0 then
			if isContainer(carryingItem.uid) == 0 then
				for b = 1, #petItems do
					if getPlayerStorageValue(cid, petItems[b]) == 0 or getPlayerStorageValue(cid, petItems[b]) == -1 then
						mySto = b
						break
					end
				end
				local count = 1
				if mySto ~= 0 then
					local theID = carryingItem.itemid
					if isItemStackable(theID) == 1 then
						count = carryingItem.type
						doRemoveItem(carryingItem.uid, carryingItem.type)
					else
						doRemoveItem(carryingItem.uid, 1)
					end
					setPlayerStorageValue(cid, petItems[mySto], theID*1000+count)
					if count == 1 then
						doCreatureSay(daPet, 'Hmm, a ' .. getItemName(theID) .. ', I\'ll save it on my bag number ' .. mySto .. '!', TALKTYPE_ORANGE_1)
					else
						doCreatureSay(daPet, 'Hmm, ' .. count .. ' ' .. getItemName(theID) .. 's, I\'ll save them on my bag number ' .. mySto .. '!', TALKTYPE_ORANGE_1)
					end
				else
					doCreatureSay(daPet, 'I have no space!', TALKTYPE_ORANGE_1)
				end
			else
				doCreatureSay(daPet, 'I can\'t take containers!', TALKTYPE_ORANGE_1)
			end
		else
			doCreatureSay(daPet, 'I can\'t see any item!', TALKTYPE_ORANGE_1)
		end
	else
		doPlayerSendCancel(cid, 'You haven\'t call your pet!')
	end
	return setExhausted(cid)
end
IT'S NOT TESTED, I DON'T HAVE TFS 3.0 DATABASE, I WOULD BE PLEASED IF YOU SEND IT TO ME BY PM.

When I attack a player or a monste with the pet, it just stands there and attacks only if the monster/player is beside it.. How do I make the pet to run to his foe and attack?

That's strange, but that error isn't releated to my script.
 
Last edited:
Hey FedeIV

I've discovered an error with summoning the pet. Im using TFS 0.2.14
If i try to summen the pet creature it says "Not Enough Room" and the server side console says LUA Doconvicecreature<>. Creature not found. Also Monstername not found? Very weird..

PS: it worked on TFS 0.2.13 so..

Thx in advance,
Wodian
 
Pet hp and mana depends on your level.
Damage formula depends on pet's magic level, and owner level
When im lvl 100 and ive got maybe 550hp the rat still have 20hp! anyway the attack is also still the same... im using last tfs 8.22
 
If I want Pets to work only with Premium players, all I need is to put "if isPremium(cid) == TRUE then" on the !pet script right?
But where should I put it and where should I put the message "Only Premium Players can call a pet"
 
Someone please help what do I have to put on the !pet file to make it only possible for Premium Players to use pet ??
Or maybe only Premium Players who bought a Pet???
Please help!
 
Please help..

[05/10/2008 12:50:02] Lua Script Error: [TalkAction Interface]
[05/10/2008 12:50:02] in a timer event called from:
[05/10/2008 12:50:02] data/talkactions/scripts/pets/!pet.lua:eek:nSay

[05/10/2008 12:50:02] luaGetPlayerStorageValue(). Player not found

[05/10/2008 12:50:02] Lua Script Error: [TalkAction Interface]
[05/10/2008 12:50:02] in a timer event called from:
[05/10/2008 12:50:02] data/talkactions/scripts/pets/!pet.lua:eek:nSay

[05/10/2008 12:50:02] luaSetPlayerStorageValue(). Player not found
 
MY SINCERELY CONGRATULATIONS MY MAN!! xP

Congratulations to you !! =D I will use it in july when I open up my own server XD thanks :p
 
I can't even summon the pet. It says I don't have enough space.
 
Last edited:
Back
Top