Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local LastMessage = os.time() -- this only runs once, it sets the LastMessage variable to the time
- local MessageDelay = 2 -- your bot will only respond to a message every x seconds
- local AdvertisementTimer = 35
- LastAdvertisement = os.time()
- -- Advertising, messagedelay means if player sends 2 messages within 1 sec you will answer only 1, it will send each message every 2 second
- -- it will not reply to player when it's ready to advertise within 35 secs, after it did it will start again
- Module.New('Advertisement', function(Mod)
- if (os.time()-LastAdvertisement)>AdvertisementTimer then
- Self.Say('Hello! If you want to purchase any available AFK scripts, then ask me in local chat or private message for "help" or "info"!')
- LastAdvertisement = os.time()
- end
- end)
- -- localspeechs are local messages
- LocalSpeechProxy.OnReceive("DanceStatus", function(proxy, mtype, speaker, level, text)
- if (os.time()-LastMessage)>MessageDelay then
- -- lower text are if player writes like "iNfO" it will understand, doesnt matter its uppercase or lower
- lowertext = string.lower(text)
- if text == 'info' then
- Self.PrivateMessage(speaker, 'Hey '..speaker..', you can write following words through pm or local chat to get answer from your questions: "about", "why", "rashid", "fury gate", "level", "rules", "addons", "mounts", "frags", "exp share" or "bye".')
- -- last messages means that when player sends a lot of messages, it will see the LAST one and reply to that one if it's added somewhere
- LastMessage = os.time()
- elseif text == 'help' then
- Self.PrivateMessage(speaker, 'Oh, it seems to look like a player needs my answers, use following words in pm or local chat to get answer: "about", "why", "rashid", "fury gate", "level", "rules", "addons", "mounts", "frags", "exp share" or "bye".')
- LastMessage = os.time()
- elseif text == 'hi' then
- Self.PrivateMessage(speaker, 'Hey '..speaker..', are you trying to talk to me?!')
- LastMessage = os.time()
- -- speaker is only x player written down which says text and it will follow that order, other people can't except speaker with name
- -- if it's only speaker, it means all players, if speaker == 'name' then only Name can
- elseif speaker == 'Dyablo' and text == 'yell' then
- Self.Yell('Hello! If you want to get any answer from following words, write them to me by PRIVATE MESSAGE: "about", "why", "rashid", "fury gate", "level", "rules", "addons", "mounts", "frags", "exp share" or "bye".')
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement