• 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!

[NPC] Auto Eventer

ELEM3NT

LUA Status: Beginner
Joined
Mar 12, 2009
Messages
191
Reaction score
0
Location
In your room without you knowing.
Okay, well I know I've requested this kind of script many times but now I will try to make it clear as possible. If you can do this please feel free to do so, I will gladly REP+++ you and give you a big thanks! :thumbup:

Explaining: Okay, well I want somebody to please make me a NPC that does a talkaction scripts, like a command pretty much. It just sits there and you can't talk to it or anything, it's just there to do commands. Im pretty sure this should be possible because somewhere I can't remember, I remember a NPC script that can selfsay /clean every 30 minutes or something like that. I want something kinda of like that /clean script but heres the thing, there will be 3 (or more, if you can make it so I can add some :D) commands that the NPC will execute, but it will execute it randomly. If you don't get what I mean here:

Code:
1)Auto Eventer NPC just standing there.

2)Each 30 minutes, he executes a command, /startevent1, /startevent2, /startevent3.

3)But each time he executes it, it will be random, so in one 30 minutes he will execute /startevent1 command, in the next 30, he will execute another random command from the /startevent1, /startevent2, /startevent3, etc..

4) I have the /startevent1 script in talkactions, so its pretty much a NPC executing 3 different talkactions but randomly.
-----------------------------------------------------------------

Heres what I had in mind, something like:

Code:
doSelfSay(math.random(/startevent1,/startevent2,/startevent3)
or something each 30 minutes.
(I'm a horrible scripter, this is just somewhat an example)

-----------------------------------------------------------------

So, if you still don't understand just post and I'll try to help you understand more!^_^ I will really appreciate it if someone got the time to make this for me, like I said, you'll get a big thanks and rep!:D

Goodbye! :peace:
 
dude if you want shit like this, go do it yourself. its not like people are yours, you have made about 4 threads about this shit now, one talkaction, globalevent, idk what else.....
 
Last edited:
Lol you are annoying..

I already made your script as talkaction:
PHP:
local t =  {
        [1] = {minutes = 1, tp={x=1000, y=1000, z=7, stackpos=255}, tpto={x=949, y=1025, z=7}, msg='The Maze Event has started! To begin, enter the portal in depot, 2 minutes remaining.',rmsg='The Maze Event portal has been removed.'},
        [2] = {minutes = 1, tp={x=1000, y=1000, z=7, stackpos=255}, tpto={x=949, y=1025, z=7}, msg='The Maze Event has started! To begin, enter the portal in depot, 2 minutes remaining.',rmsg='The Maze Event portal has been removed.'},
        [3] = {minutes = 1, tp={x=1000, y=1000, z=7, stackpos=255}, tpto={x=949, y=1025, z=7}, msg='The Maze Event has started! To begin, enter the portal in depot, 2 minutes remaining.',rmsg='The Maze Event portal has been removed.'},
    }
local howLongToSleep = 2 --in intervals


_EVENT,_SLEEP_EVENT,_EVENT_DURATION = 0,0,0
function onThink(interval, lastExecution, thinkInterval)
    local random_event = math.random(1,#t)
    
    if not(_SLEEP_EVENT <= 0) then
        _SLEEP_EVENT = _SLEEP_EVENT-1
        return true
    end
    
    if _EVENT ~= 0 then
        if _EVENT_DURATION <= 0 then
            local tile = getTileItemById(t[_EVENT].tp, 1387).uid 
            local a = tile > 0 and (doRemoveItem(tile) and doBroadcastMessage(t[_EVENT].rmsg)) or true
            _EVENT = 0
            _SLEEP_EVENT = howLongToSleep
            return true
        else
            _EVENT_DURATION = _EVENT_DURATION-1
            return true
        end
    end
    _EVENT,_EVENT_DURATION = random_event,t[random_event].minutes-1
    return doCreateTeleport(1387, t[random_event].tpto, t[random_event].tp) and doBroadcastMessage(t[random_event].msg)
end


It is NOT possible to make a npc use a talkaction. It was possible in older servers.
I just don't get why you want a npc if my script does exactly the same -.-
 
Back
Top