Luciano
Member
- Joined
- Feb 18, 2010
- Messages
- 998
- Reaction score
- 24
-- /terror text
local messageAmount = 40
error in console:
local messageAmount = 40
Code:
function onSay(cid, words, param)
if isPlayerGhost(cid) == TRUE then
enableSleep(function()
local tmpPos = {}
local i = 0
for j = 1, messageAmount * 5 do -- instead of while (for safety)
local center = getCreaturePosition(cid)
local pos = Position(math.random(center.x - 7, center.x + 7), math.random(center.y - 5, center.y + 5), center.z, 1)
local thing = getTileThingByPos(pos)
if thing.uid > 0 then
if isCreature(thing.uid) == TRUE or hasProperty(thing.uid, CONST_PROP_BLOCKINGANDNOTMOVEABLE) == FALSE and not comparePos(tmpPos, pos) then
i = i + 1
tmpPos = pos
sleep(math.random(300, 700))
doCreatureSay(cid, param, TALKTYPE_SAY, pos)
end
end
if i == messageAmount then
break
end
end
end)
else
doPlayerSendCancel(cid, "This command is only available while in ghost mode.")
end
return TRUE
end
error in console:
Code:
[18/03/2010 20:42:59] [Error - TalkAction Interface]
[18/03/2010 20:42:59] data/talkactions/scripts/frags.lua
[18/03/2010 20:42:59] Description:
[18/03/2010 20:42:59] data/lib/function.lua:432: attempt to index local 'str' (a boolean value)
[18/03/2010 20:42:59] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/frags.lua)
[18/03/2010 20:42:59] data/talkactions/scripts/terror.lua:25: unexpected symbol near ')'