• 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 Tp talkaction

Santi

Theres no way im stopping
Joined
Aug 29, 2010
Messages
1,975
Reaction score
152
Location
00
So, you say !demon, and this is supposed to tp you to demon if you have an item.
Lua:
local table = {
['!demon'] = {{x=94, y=125, z=7},5},
['!hydra'] = {{x=88, y=127, z=7},5}
}

function onSay(cid, words, param, channel)
if getPlayerItemCount(cid,2345) == TRUE then
for v = 1, #table do
if msgcontains(msg, [v]) then 		
		doTeleportThing(cid, v[1])
		doSendMagicEffect(ppos,v[2])
  elseif getPlayerItemCount(cid,2345) == FALSE then
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need a tp wand for this")
	end
return true
end
end
end

Code:
 [Error - LuaScriptInterface::loadFile] data/talkactions/scripts/tpsay.lua:9: unexpected symbol near '['
[29/11/2010 16:36:39] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/tpsay.lua)
[29/11/2010 16:36:39] data/talkactions/scripts/tpsay.lua:9: unexpected symbol near '['
[29/11/2010 16:36:39] [Error - LuaScriptInterface::loadFile] data/talkactions/scripts/tpsay.lua:9: unexpected symbol near '['
[29/11/2010 16:36:39] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/tpsay.lua)
[29/11/2010 16:36:39] data/talkactions/scripts/tpsay.lua:9: unexpected symbol near '['
 
XML:
<talkaction words="!demon;!hydra" event="script" value="script.lua"/>
Lua:
local table = {
    ['!demon'] = {{x=94, y=125, z=7}, CONST_ME_EXPLOSIONHIT},
    ['!hydra'] = {{x=88, y=127, z=7}, CONST_ME_EXPLOSIONHIT}
}
 
function onSay(cid, words, param, channel)
    local table = table[words]
    if getPlayerItemCount(cid, 2345) > 0 then
        doTeleportThing(cid, table[1])
        doSendMagicEffect(table[1],table[2])
    else
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You need a TP wand for this.')
    end
    return true
end
 
Back
Top