HowToRoblox

FeedbackGuiHandler

May 30th, 2021 (edited)
1,693
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.01 KB | None | 0 0
  1. local adminIDs = {84182809}
  2.  
  3.  
  4. local btn = script.Parent:WaitForChild("Feedback")
  5. local frame = script.Parent:WaitForChild("FeedbackFrame")
  6.  
  7.  
  8. btn.MouseButton1Click:Connect(function()
  9.    
  10.     frame.Visible = not frame.Visible
  11. end)
  12.  
  13.  
  14. frame:WaitForChild("SendButton").MouseButton1Click:Connect(function()
  15.    
  16.     game.ReplicatedStorage.FeedbackRE:FireServer(frame.FeedbackInput.Text)
  17. end)
  18.  
  19.  
  20. game.ReplicatedStorage:WaitForChild("FeedbackFolder").ChildAdded:Connect(function()
  21.    
  22.     for i, child in pairs(frame:WaitForChild("FeedbackScroller"):GetChildren()) do
  23.        
  24.         if child:IsA("TextLabel") then
  25.             child:Destroy()
  26.         end
  27.     end
  28.    
  29.     for i, child in pairs(game.ReplicatedStorage.FeedbackFolder:GetChildren()) do
  30.        
  31.         local feedbackTxt = script:WaitForChild("Feedback"):Clone()
  32.         feedbackTxt.Text = child.Name .. "\n" .. child.Value
  33.  
  34.         feedbackTxt.Parent = frame.FeedbackScroller
  35.     end
  36. end)
  37.  
  38.  
  39. if not table.find(adminIDs, game.Players.LocalPlayer.UserId) then
  40.    
  41.     frame:WaitForChild("FeedbackScroller").Visible = false
  42. end
Add Comment
Please, Sign In to add comment