This is funny command I made to terror my players hueahuea
First you need these functions: Sleep function, Position function
Then go to data/talkactions/talkactions.xml and write:
And in data/talkactions/scripts make file called "terror.lua" and in it paste this code:
Have fun terrorizing your players,
Colandus
First you need these functions: Sleep function, Position function
Then go to data/talkactions/talkactions.xml and write:
Code:
<talkaction words="/terror" access="4" script="terror.lua"/>
And in data/talkactions/scripts make file called "terror.lua" and in it paste this code:
Code:
-- /terror text
local messageAmount = 40
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
Have fun terrorizing your players,
Colandus
Last edited: