Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local plrs = game:GetService("Players")
- local runService = game:GetService("RunService")
- local localPlayer = plrs.LocalPlayer
- repeat wait() until game.ReplicatedStorage:FindFirstChild("DefaultChatSystemChatEvents")
- local event = game.ReplicatedStorage.DefaultChatSystemChatEvents.SayMessageRequest
- local cmds = "TechHog's Chat-Bot commands are :say, leaderstats, cmdlist, friends, friendcount, jumpspersecond, joindate, plrlist, speed, jumppower. How to use TechHog's Chat-Bot: type /unmute command player and press enter. For speed and jumppower, type /unmute command ammount and press enter."
- local function getfriends(userId)
- local function iterPageItems(pages)
- return coroutine.wrap(function()
- local pagenum = 1
- while true do
- for _, item in ipairs(pages:GetCurrentPage()) do
- coroutine.yield(item, pagenum)
- end
- if pages.IsFinished then
- break
- end
- pages:AdvanceToNextPageAsync()
- pagenum = pagenum + 1
- end
- end)
- end
- local friendPages = plrs:GetFriendsAsync(userId)
- local usernames = {}
- for item, pageNo in iterPageItems(friendPages) do
- table.insert(usernames, item.Username)
- end
- return usernames
- end
- local function command(player,comand,second, third)
- for i,target in pairs(plrs:GetPlayers()) do
- if string.match(target.Name, second, third) then
- comand(target)
- end
- end
- end
- local function leaderstats(target)
- if target:FindFirstChild("leaderstats") then
- event:FireServer(target.Name..'s leaderstats are:','All')
- for a,stat in pairs(target.leaderstats:GetChildren()) do
- event:FireServer('Name: '..tostring(stat.name..'. ')..'Value: '..tostring(stat.Value..'. '),'All')
- end
- end
- end
- local function friends(target)
- local usernames = getfriends(target.UserId)
- local targetFriends = ''
- for a,user in pairs(usernames) do
- targetFriends = targetFriends .. user
- end
- event:FireServer(target.Name..'s friends are: '..tostring(targetFriends),'All')
- end
- local function friendcount(target)
- local frens = 0
- local usernames = getfriends(target.UserId)
- for a,user in pairs(usernames) do
- frens = frens + 1
- end
- event:FireServer(target.Name..' has '..tostring(frens)..' friends!','All')
- end
- local function joindate(target)
- local day = 60 * 60 * 24
- local tm = os.time() - (day * target.AccountAge)
- local date = os.date("!*t", tm)
- event:FireServer(target.Name..'s join date is: ' .. date.month.. 'm-' .. date.day .. 'd-' .. date.year .. 'y','All')
- end
- local function jumpspersecond(target)
- if target:FindFirstChild("leaderstats") then
- if target.leaderstats:FindFirstChild("Jumps") then
- local jumps = target.leaderstats.Jumps
- local jumpsValue1 = jumps.Value
- wait(1)
- local jumpsValue2 = jumps.Value
- local jps = jumpsValue2-jumpsValue1
- event:FireServer('Wow! '..target.Name..' is jumping '..tostring(jps)..' jumps per second!','All')
- end
- end
- end
- local function speed(target, speed)
- if target.Character then
- target.Character:WaitForChild("Humanoid").WalkSpeed = tonumber(speed)
- end
- end
- local function jumppower(target, jumppower)
- if target.Character then
- target.Character:WaitForChild("Humanoid").JumpPower = tonumber(jumppower)
- end
- end
- for a,human in pairs(game:GetService("Players"):GetPlayers()) do
- human.Chatted:connect(function(msg)
- local args = string.split(msg,' ')
- if args[1] == '/unmute' then
- if args[2] == 'say' then
- event:FireServer(tostring(string.sub(msg, string.len(args[1]) + string.len(args[2]) + 2)),'All')
- end
- if args[2] == 'cmdlist' then
- event:FireServer(cmds, 'All')
- end
- if args[2] == 'leaderstats' then
- command(localPlayer,leaderstats,args[3])
- end
- if args[2] == 'friends' then
- command(localPlayer,friends,args[3])
- end
- if args[2] == 'friendcounter' then
- command(localPlayer,friendcount,args[3])
- end
- if args[2] == 'joindate' then
- command(localPlayer,joindate,args[3])
- end
- if args[2] == 'jumpspersecond' then
- command(localPlayer,jumpspersecond,args[3])
- end
- if args[2] == 'plrlist' then
- local plrlist = ''
- for a,target in pairs(plrs:GetPlayers()) do
- plrlist = plrlist..' '..target.Name
- end
- event:FireServer('Players in the game include: '..plrlist,'All')
- end
- if args[2] == 'plrcount' then
- local plrcount = 0
- for a,target in pairs(plrs:GetPlayers()) do
- plrcount = plrcount + 1
- end
- event:FireServer('There are '..tostring(plrcount)..' players in this game!','All')
- end
- if args[2] == 'speed' then
- speed(localPlayer, args[3])
- end
- if args[2] == 'jumppower' then
- jumppower(localPlayer, args[3])
- end
- end
- end)
- end
Add Comment
Please, Sign In to add comment