---Made By Huggen---
--Credits To All Who Helped Me Learn Lua-->
--Config--
local cash = 1 -- Money needed to Braodcast
local levelneeded = 50 -- Level needed to broadcast
local lenght = 50 -- Max lenght of msg
local messagesort = MESSAGE_STATUS_WARNING -- can be "MESSAGE_STATUS_WARNING" or "TALKTYPE_ORANGE_1" check your global.lua for more...
--End of config--
function onSay(cid, words, param)
if isExhausted(cid) == 1 then
return 0
end
local name = getPlayerName(cid)
local level = getPlayerLevel(cid)
if isCreature(cid) == 1 then
if param ~= nil then
if string.len(param) < lenght then
if level >= levelneeded then
if doPlayerRemoveMoney(cid, 7910, 1)) == TRUE then
broadcastMessage( ''..name..' ['..level..'] says: ' .. param .. '', messagesort)
else
doPlayerSendCancel(cid, 'You need '..cash..' epic peanut to broadcast! YOU TO POOR!')
end
else
doPlayerSendCancel(cid, 'You need to be level '..levelneeded..' to broadcast! YOU TO NOOBY!')
end
else
doPlayerSendCancel(cid, 'No more than ' .. lenght .. ' character. ')
end
else
doPlayerSendCancel(cid, 'You must enter a text')
end
else
doPlayerSendCancel(cid, 'You haven\'t a target!')
end
return setExhausted(cid)
end
I'm getting the error :data/talkactions/scripts/broadcast1.lua:25: 'then' expected near ')'
so can any one fix this and send me it in private?
thanks~~