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

[LUA] Talkaction!

Ferre

New Member
Joined
Feb 11, 2011
Messages
10
Reaction score
0
Hello OTLand Forum!

I need help to make a script that will use X item on myself when I say X word..

For example a manafluid, instead of a normal hotkey, it will work like this:

I say "!usemana" and my character will use a manafluid on myself. Understand? :)

Also I want it to sparkle (like UH rune) when its used and if I dont have a manafluid it will say "Sorry, you need a manafluid."

Distro: Avesta 7.6 SQL

Thanks in advance!
 
Last edited:
Code:
local manapot = ITEMIDHERE
local manatoadd = MANATOADDHERE

function onSay(cid, words, param)
if doPlayerRemoveItem(cid, manapot, 1)
	doCreatureAddMana(cid, manatoadd)
end
end

edit: obviously change the ITEMIDHERE and MANATOADDHERE to the item id for the mana potion and the mana that you want it to give
this won't give you an empty mana potion, and it only has the exhaustion you set for talk actions in your config ;)
 
Thanks and how do you do this on Avesta 7.6 sql? they use normal manafluids.. how? ;) Thanks


Because I get this error:

Could not load script: Lua:6 'then' expected near 'doCreatureAddMana'
 
Last edited:
Thanks and how do you do this on server where is below 8.0 (doesnt have manapot) they use normal manafluids.. how? ;) Thanks

you basically replace ITEMIDHERE with whatever item you wish to remove from them, it can be anything at all, even gold ;)

what distro are you using? if it's an old one doCreatureAddMana will need changing to doPlayerAddMana too :p
 
I use avesta server for tibia 7.6 it is sql!


Now I get Could not load script: Lua:6 'then' expected near 'doPlayerAddMana'


This is another talkaction for me for buying aol maybe it helps you to fix:

function onSay(cid, words, param)
local cost = 50000
local item = 2173
local quantity = 1
if doPlayerRemoveMoney(cid, cost) == TRUE then
doPlayerAddItem(cid, item, quantity)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Here you are!")
else
doPlayerSendCancel(cid, "You don't have enough gold.")
end
return FALSE
end
 
whooooooopsie
Code:
local manapot = ITEMIDHERE
local manatoadd = MANATOADDHERE

function onSay(cid, words, param)
if doPlayerRemoveItem(cid, manapot, 1) then
	doCreatureAddMana(cid, manatoadd)
end

end
 
Code:
	<talkaction words="/online" hide="yes" event="script" value="online.lua"/>
just add the hide="yes" in the talkactions.xml for your... oh i can't word it but you can see what i mean lol
 
I need to write someting "return false" in the script somewhere please help.. And if I dont have this item i need can you make like "Sorry, you don't have a manafluid."
 
Last edited:
Lua:
function onSay(cid, words, param)
	if doPlayerRemoveItem(cid, 2006, 7) == TRUE then
		doPlayerAddMana(cid, math.random(50, 150))
		doSendMagicEffect(getPlayerPosition(cid), 12)
		doPlayerSay(cid, "Aaaah...", 1)
	else
		doPlayerSendCancel(cid, 'Sorry, you need a manafluid.')
	end
	return FALSE
end
 
It didnt wo rk, it says "Sorry you need a manafluid. But I have one.. I know you can do this cykotitan!! :D
 
Last edited:
It didnt wo rk, it says "Sorry you need a manafluid. But I have one.. I know you can do this cykotitan!! :D

Lua:
function onSay(cid, words, param)
	if doPlayerRemoveItem(cid, 2006, 1) == TRUE then[B] --Replace 2006 with the mana fluid you want[/B] (also, it was set to remove 7?)
		doPlayerAddMana(cid, math.random(50, 150))
		doSendMagicEffect(getPlayerPosition(cid), 12)
		doPlayerSay(cid, "Aaaah...", 1)
	else
		doPlayerSendCancel(cid, 'Sorry, you need a manafluid.')
	end
	return FALSE
end
 
Lua:
function onSay(cid, words, param)
	if doPlayerRemoveItem(cid, 2006, 1, 7) == TRUE then
		doPlayerAddMana(cid, math.random(50, 150))
		doSendMagicEffect(getPlayerPosition(cid), 12)
		doPlayerSay(cid, "Aaaah...", 1)
	else
		doPlayerSendCancel(cid, 'Sorry, you need a manafluid.')
	end
	return FALSE
end
(also, it was set to remove 7?)
No, 1, but it looks like it has to be the 4th param.
7 is subtype of mana fluid, gotta make sure it doesn't remove empty or non-manafluid vials.
 
what kind of exhaust, because it should already have the 1 sec exhaust like all items. did you mean you want it to exhaust healing spells?
 
Back
Top