I have a script I have been trying to make, and it does not want to seem to make a GUI show up on respawn. This is basically what I have (This is not the whole script since the entire script is 300 lines long).
local re = game:GetService('ReplicatedStorage'):FindFirstChild('********') or game:GetService('ReplicatedStorage'):WaitForChild('********') script.Parent = nil print('Report Gui: Connected To Server') local main=nil local disabled=false local players={} local abuses={'Glitching','Obscenities','Team Killing','Admin Impersonation','Ban Evasion','Harassment','Exploitation','Vandalism','Other (Give Description)'} function Button() repeat wait() until game:GetService('Players').LocalPlayer:FindFirstChild('PlayerGui') local ScreenGui = Instance.new('ScreenGui',game:GetService('Players').LocalPlayer:FindFirstChild('PlayerGui')) local ReportButton = Instance.new('TextButton',ScreenGui) ReportButton.BackgroundColor3 = Color3.new(1,1,1) ReportButton.BorderSizePixel = 0 ReportButton.Position = UDim2.new(0,5,1,-55) ReportButton.Size = UDim2.new(0,90,0,50) ReportButton.Style = Enum.ButtonStyle.RobloxRoundDropdownButton ReportButton.Font = Enum.Font.SourceSansBold ReportButton.FontSize = Enum.FontSize.Size14 ReportButton.Text = 'Report' ReportButton.TextColor3 = Color3.new(0.76862752437592,0.15686275064945,0.10980392992496) ReportButton.TextStrokeColor3 = Color3.new(0.15686275064945,0.15686275064945,0.15686275064945) ReportButton.TextStrokeTransparency = 0.80000001192093 ReportButton.TextWrapped = true ReportButton.Active = not disabled return {ScreenGui,ReportButton} end function Load() repeat wait() until game:GetService('Players').LocalPlayer:FindFirstChild('PlayerGui') main = Button() main[2].MouseButton1Click:connect(function() if not disabled then for _,v in pairs(game.Players:GetChildren()) do table.insert(players,#players+1,{v.Name,v.userId}) end MainGui() end end) end game:GetService('Players').LocalPlayer.CharacterAdded:connect(function() Load() end) Load()
If anyone knows why the GUI will not load on respawn, I would greatly appreciate a fix. The reason I can't fix it myself is because I don't know what's going wrong, and there are absolutely no errors. Thank you for the help!