I want to make a GUI that shows the text of recent player's sayings. So far I have this but it doesn't seem to work I might be doing something wrong but im not sure. How would I get the players recent sayings and put it in a GUI? [SCRIPT]
MainPlayer = game.Players.SavageMunkey
logs = {}
function GetLogs(name)
local log = "Logs:"
for i = 1,#logs do
if logs[i] == logs[name] then
log = log..table.concat(logs[name])
else
end
end
return log
end
function getLogz(m, plr)
if m:sub(1,8) == "getlogs;" then
plr = game.Players[m:sub(9)]
local SG = Instance.new("ScreenGui",plr.PlayerGui)
local SGF = Instance.new("Frame",SG)
local SGTB = Instance.new("TextButton")
SGTB.Size = UDim2.new(0, 500, 0, 500)
SGTB.Position = UDim2.new(.5,0,.5,0)
SGTB.Text = _G.GetLogs(plr)
SGTB.MouseButton1Down:connect(function()
SG:Destroy()
end)
end
table.insert(logs(plr.Name)) -- idk if this is right
end
MainPlayer.Chatted:connect(getLogz)

2 comments
Edit your post to use the Lua code formatting feature.
It should be table.insert(logs,1,p.Name .. '-' .. m) on line 27. Logs bing the name of the table, 1 bing the position the object will be placed so it's the most recent, and plr.Name and m to record the chat.