-- don't do nothin

end)

gui.Frame.BanButton.Activated:connect(function()
	if requesting then return end
	
	requesting = true
	local result = rep.Events.ModAction:InvokeServer("ban",gui.Frame.InputBox.Text)

	if result then
		gui.Frame.Actions.Text = "Successfully banned "..gui.Frame.InputBox.Text
	else
		gui.Frame.Actions.Text = "Error, user not found"
	end
	gui.Frame.InputBox.Text = ""
	
	requesting = false
end)

gui.Frame.UnbanButton.Activated:connect(function()
	if requesting then return end
	
	requesting = true
	local result = rep.Events.ModAction:InvokeServer("unban",gui.Frame.InputBox.Text)

	if result then
		gui.Frame.Actions.Text = "Successfully unbanned "..gui.Frame.InputBox.Text
	else
		gui.Frame.Actions.Text = "Error, user not found"
	end
	gui.Frame.InputBox.Text = ""
	
	requesting = false
end)

gui.Frame.ExitButton.Activated:connect(function()
	gui.Frame.Visible = false
end)

gui.OpenButton.Activated:connect(function()
	gui.Frame.Visible = not gui.Frame.Visible
end)

rep.Events.PromptModConsole.OnClientEvent:connect(function()
	player.PlayerGui.ModConsole.Enabled = true
end)

gui.Frame.F9LogButton.Activated:connect(function()
	gui.Frame.Actions.Text = "Success, press F9 or access the dev console to view the mod log"
	local log = rep.Events.RequestModLog:InvokeServer()
	for _,entry in next,log do
		--[[
			timeBanned = tick(),
			bannedName = targetName,
			bannedID = targetID,
			reason = "",
		--]]
		local temp = os.date("*t", entry.timeBanned)
		
		print(entry.action,entry.bannedName,"(id "..entry.bannedID..")","for reason:",entry.reason,"on",temp.month.."/"..temp.day.."/"..temp.year)
	end
end)
