Whenever my friends play test the game to see the loading screen i made it always breaks but it works find for me when i play test but whenever i do a team test it breaks.
Heres whats happening when it breaks.
Basically i get this error: attempt to index nil with 'Enabled'
Heres the kicker whenever i click the error to have it take me to the script the script has nothing in it and its the right script cause i checked.
This is the code thats supposed to be in it:
local repstorage = game:GetService("ReplicatedStorage")
local repfirst = game:GetService("ReplicatedFirst")
local contentprovider = game:GetService("ContentProvider")
local ts = game:GetService("TweenService")
local startergui = game:GetService("StarterGui")
local assets = game:GetDescendants()
local ui = script.LoadingScreenGui:Clone()
local player = game.Players.LocalPlayer
local playergui = player:WaitForChild("PlayerGui")
startergui:SetCoreGuiEnabled(Enum.CoreGuiType.All,false)
repfirst:RemoveDefaultLoadingScreen()
repeat wait() until game.Loaded
ui.Parent = playergui
for i=1, #assets do
local asset = assets[i]
contentprovider:PreloadAsync({asset})
ui.MainFrame.Asset.Text = "Assets:["..i.."/"..#assets.."]"
end
local event = repstorage:WaitForChild("MenuEvent")
local TextChatService = game:GetService("TextChatService")
TextChatService:FindFirstChildOfClass("ChatInputBarConfiguration").Enabled = false
TextChatService:FindFirstChildOfClass("ChatWindowConfiguration").Enabled = false
print("Loading Complete")
ui.MainFrame.Asset.Text = "Loading Complete"
task.wait(1)
ui.MainFrame.Asset.Text = "Please wait..3"
task.wait(1)
ui.MainFrame.Asset.Text = "Please wait..2"
task.wait(1)
ui.MainFrame.Asset.Text = "Please wait..1"
task.wait(1)
ui.MainFrame.Asset.Text = "Please wait..0"
task.wait(1)
event:Fire()
ui:Destroy()
script:Destroy()
The place the script and gui is at:
If you have any information on why this is happening please let me know.