Advertisement
InTesting

Join Logger

Jul 1st, 2019
302
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.34 KB | None | 0 0
  1. --// Variables
  2. -- // Services
  3. local players = game:GetService("Players")
  4. local reps = game:GetService("ReplicatedStorage")
  5.  
  6. -- // Instaces
  7. local sg = Instance.new('ScreenGui',owner:FindFirstChildWhichIsA'PlayerGui')
  8. sg.ResetOnSpawn = false
  9.  
  10. local f1 = Instance.new('Frame',sg)
  11. f1.AnchorPoint = Vector2.new(.5,.5)
  12. f1.BackgroundColor3 = Color3.new(0,0,0)
  13. f1.BackgroundTransparency = .5
  14. f1.Position = UDim2.new(.5,0,.5,0)
  15. f1.Size = UDim2.new(.375,0,.5,0)
  16. f1.Active = true
  17. f1.Selectable = true
  18.  
  19. local sf = Instance.new('ScrollingFrame',f1)
  20. sf.BackgroundColor3 = Color3.new(0,0,0)
  21. sf.Size = UDim2.new(.75,0,1,0)
  22. sf.ClipsDescendants = true
  23. sf.CanvasSize = UDim2.new(0,0,0,50)
  24. sf.ScrollingDirection = Enum.ScrollingDirection.Y
  25.  
  26. local TLd = Instance.new("TextLabel",sf)
  27. TLd.BackgroundColor3 = Color3.new(0, 0, 0)
  28. TLd.Size = UDim2.new(1,0,0,50)
  29. TLd.Font = Enum.Font.Code
  30. TLd.Text = '[[ Start of Join Logs]]'
  31. TLd.TextColor3 = Color3.new(255, 255, 255)
  32. TLd.TextScaled = true
  33.  
  34. local re1 = reps:FindFirstChild('AS_RE1',true)
  35.  
  36. -- // Values
  37. local lognum = 0
  38.  
  39.  
  40.  
  41. --// Default Properties
  42. sg.Enabled = true
  43. f1.Draggable = true
  44. f1.Position = UDim2.new(.5,0,.5,0)
  45.  
  46.  
  47.  
  48. --// Functions
  49. local function Gui_In()
  50.     f1:TweenPosition(UDim2.new(.5,0,.5,0))
  51.     wait(1)
  52.     f1.Draggable = true
  53. end
  54. local function Gui_Out()
  55.     f1.Draggable = false
  56.     if f1.Position~=UDim2.new(.5,0,.5,0)then
  57.         f1:TweenPosition(UDim2.new(.5,0,.5,0))
  58.         wait(1)
  59.     end
  60.     f1:TweenPosition(UDim2.new(1.25,0,.5,0))
  61.     wait(1)
  62. end
  63. local function MakeLog(pl,msg)
  64.     for _,v in pairs(sf:GetChildren())do
  65.         local vpos = v.Position
  66.         v.Position = UDim2.new(vpos.X.Scale,vpos.X.Offset,vpos.Y.Scale,vpos.Y.Offset + 50)
  67.     end
  68.     sf.CanvasSize = UDim2.new(sf.CanvasSize.X.Scale,sf.CanvasSize.X.Offset,sf.CanvasSize.Y.Scale,sf.CanvasSize.Y.Offset + 50)
  69.     local TL = Instance.new("TextLabel",sf)
  70.     TL.BackgroundColor3 = Color3.new(0, 0, 0)
  71.     TL.Size = UDim2.new(1,0,0,50)
  72.     TL.Font = Enum.Font.Code
  73.     TL.Text = (pl.Name..' '..msg..'.')
  74.     TL.TextColor3 = Color3.new(255, 255, 255)
  75.     TL.TextScaled = true
  76. end
  77.  
  78. --// Events
  79. --[[
  80. re1.OnClientEvent:Connect(function(arg1)
  81.     if arg1=='GetGui'then
  82.         Gui_In()
  83.     elseif arg1=='DestroyGui'then
  84.         Gui_Out()
  85.     end
  86. end)
  87. --]]
  88. players.PlayerAdded:Connect(function(pl)
  89.     MakeLog(pl,'joined')
  90. end)
  91. players.PlayerRemoving:Connect(function(pl)
  92.     MakeLog(pl,'left')
  93. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement