Credits to Cykotitan
When you make script and it doesn't work you need to check what is wrong (storages,names,uids). I asked Cykotitan about help and he sent me this talkaction. VERY USEFUL!
talkactions.xml
executelua.lua
How to use:
Show in 'Server Log' value of storage ID 15000 of player 'Burt Simpson" (only when he is online).
Show in 'Server Log' 0 - if no creature on tile or UID of top creature (value > 0)
You can write longer scripts ^_^
---------------
Tested on TFS 0.4, should work on 0.3.6pl1.
When you make script and it doesn't work you need to check what is wrong (storages,names,uids). I asked Cykotitan about help and he sent me this talkaction. VERY USEFUL!
talkactions.xml
PHP:
<talkaction log="yes" words="!lua" access="5" event="script" value="executelua.lua"/>
PHP:
function onSay(cid, words, param, channel)
function fuck(...)
local t = {}
for i = 2, arg.n do
local v = tostring(arg[i])
if v:len() > 0 then
table.insert(t, v)
end
end
if #t > 0 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, table.concat(t, ', '))
end
end
fuck(pcall(loadstring('local cid = ' .. cid .. ' ' .. param)))
return true
end
How to use:
PHP:
!lua return getCreatureStorage(getCreatureByName("Burt Simpson"), 15000)
PHP:
!lua return getTopCreature({x=1,y=1,z=1}).uid
You can write longer scripts ^_^
---------------
Tested on TFS 0.4, should work on 0.3.6pl1.