I have ResetOnSpawn checked off, and it still happens.
local buttonsGui = script.Parent.Parent.Parent.Buttons.ButtonsGui
local loadingGui = script.Parent
local loadingFrame = loadingGui:WaitForChild("MainFrame")
local ts = game:GetService("TweenService")
local backgroundFrame = loadingFrame:WaitForChild("BackgroundBar")
local movingBar = backgroundFrame:WaitForChild("MovingBar")
local buttonsFrame = buttonsGui:WaitForChild("ButtonsFrame")
local loadingTime = 3
local hasLoaded = false
local function tweenOut()
local tween = ts:Create(loadingFrame, TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {Position = UDim2.new(0.5, 0, -1.5, 0)})
tween:Play()
end
local function startLoading()
print("Loading")
buttonsGui.Enabled = false
loadingFrame.Visible = true
hasLoaded = true
movingBar.Size = UDim2.new(0, 0, 1, 0)
local tween = ts:Create(movingBar, TweenInfo.new(loadingTime, Enum.EasingStyle.Linear), {Size = UDim2.new(1, 0, 1, 0)})
tween:Play()
tween.Completed:Connect(function()
buttonsGui.Enabled = true
tweenOut()
task.wait(0.7)
loadingFrame.Visible = false
end)
end
if not hasLoaded then
startLoading()
end
Loading prints every time I respawn. Thank you, and let me know if you need anything else from me! (Script prob is not the best lol)
Yes, it is the only thing that has anything to do with the loading bar. I do have a script that sets the players base and stuff, but I do not think that would have to do with it. (I asked AI also, and it could not help me)
function BaseService.teleportToBase(plr, base)
base = base or baseOfPlayer[plr]
if not base then return end
local spawnPad = base:FindFirstChild("SpawnPad")
local chr = plr.Character
if spawnPad and chr then
chr:PivotTo(spawnPad.CFrame + Vector3.new(0, 5, 0))
end
end
I do this to teleport them to the base. And call it here
Your loading GUI should absolutely be in ReplicatedFirst, not StarterGUI. At the beginning of the video you can see the other GUI loaded first, which can be avoided by allowing ReplicatedFirst make your GUI before anything else is.