Thorn
Spriting since 2013
Hello guys, i got this script from the forum, buit it gives me an error, does anyone know how to fix it?
and i get this error:
plz help
Lua:
function onSay(cid, words, param, channel)
local t = string.explode(param, ",")
if t[1] ~= nil and t[2] ~= nil then
doBroadcastMessage(getPlayerName(cid) .. " give: " .. t[2] .." ".. getItemNameById(t[1]) .. " for all players online!")
local list = {}
for i, player in ipairs(getPlayersOnline()) do
local playerIp = getPlayerIp(player)
if not list[tostring(playerIp)] then
list[tostring(playerIp)] = player
end
end
if next(list) then
for ip, pid in pairs(list) do
if isPlayer(pid) then
doPlayerAddItem(pid, t[1], t[2])
end
end
end
else
doPlayerPopupFYI(cid, "No param...\nSend:\n /itemadd itemid,how_much_items\nexample:\n /itemadd 2160,10")
end
return true
end
and i get this error:
Code:
Lua Script Error: [TalkAction Interface]
data/talkactions/scripts/giveall.lua:onSay
data/talkactions/scripts/giveall.lua:2: attempt to call field 'explode' (a nil value)
stack traceback:
[C]: in function 'explode'
data/talkactions/scripts/giveall.lua:2: in function <data/talkactions/scripts/giveall.lua:1>
plz help