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

Lua Talkaction prob!

Oscar Lyis

Donator
Joined
May 30, 2008
Messages
633
Reaction score
1
Location
Sweden
Here is the script:

Code:
function onSay(cid, words, param)
	if getPlayerBlessing(cid,5) == TRUE then
	doPlayerSendCancel(cid,"You already have all the blessings!, Du har redan alla de välsignelser!")
	doSendMagicEffect(getPlayerPosition(cid),2)
else
	if doPlayerRemoveMoney(cid,10000) == TRUE then
		for i = 1, 5 do
			doPlayerAddBlessing(cid, i)
			doSendMagicEffect(getPlayerPosition(cid),12)
			doPlayerSendTextMessage (cid,22,"You've bought all the Blessings!, Du har köpt alla välsignelser")
		end
	else
		doPlayerSendCancel(cid,"You don't have enough money, Du har inte tillräckligt med pengar."
		doSendMagicEffect(getPlayerPosition(cid),2)
		end
	end
	return TRUE

And here is the error code: Warning:[Event::LoadScript]Can not load script. data/talkaction/scripts/buyallblessings.lua
data/talkaction/scripts/buyallblessings.lua:14:')' expected (to close '(' at line 13 near 'DoSendMagicEffect'

Thanks in advance
 
Fixed.
LUA:
function onSay(cid, words, param)
	if getPlayerBlessing(cid,5) == TRUE then
	doPlayerSendCancel(cid,"You already have all the blessings!, Du har redan alla de välsignelser!")
	doSendMagicEffect(getPlayerPosition(cid),2)
else
	if doPlayerRemoveMoney(cid,10000) == TRUE then
		for i = 1, 5 do
			doPlayerAddBlessing(cid, i)
			doSendMagicEffect(getPlayerPosition(cid),12)
			doPlayerSendTextMessage (cid,22,"You've bought all the Blessings!, Du har köpt alla välsignelser")
		end
	else
		doPlayerSendCancel(cid,"You don't have enough money, Du har inte tillräckligt med pengar.")
		doSendMagicEffect(getPlayerPosition(cid),2)
		end
	end
	return TRUE
 
Thanks dude!

EDIT:
Using that script ^ up there!
New error :s

Warning:[Event::LoadScript]Can not load script. data/talkaction/scripts/buyallblessings.lua
data/talkaction/scripts/buyallblessings.lua:17: 'end' expected (to close 'function' at line 1) near '<eof>'
 
Last edited:
Back
Top