I have a game with two places.
One is the spawn and other is the game area.
I have added a loading screen to the main place. so that when people enter the game the loading screen will be shown.
To play i teleport the players to the ‘game area place’.
While coming back, it shows the loading screen of the spawn area, which I dont want to show because the player is already in the game.
I have placed the loading screen in ReplicatedFirst and i dont have any idea how to tell the loading screen to not show when the player is coming back from ‘game area’??
Is there any way to achieve this??
Here is my loading screen script kept in ReplicatedFirst
-- Imports
game.ReplicatedFirst:RemoveDefaultLoadingScreen()
local TweenService = game:GetService("TweenService")
local player = game.Players.LocalPlayer
local PlayerModule = require(game.Players.LocalPlayer.PlayerScripts:WaitForChild("PlayerModule"))
local StarterPlayer = game:GetService("StarterPlayer")
local PlayerGUI = player.PlayerGui
local ReplicatedStorage = game:GetService('ReplicatedStorage')
local ingamegui = PlayerGUI:WaitForChild("ScreenGui")
-- Getting required things
local Controls = PlayerModule:GetControls()
Controls:Disable()
StarterPlayer.CharacterJumpPower = 0
ingamegui.Enabled = false
-- The loading screen GUI
local GUI = script.ScreenGui:Clone()
GUI.Parent = PlayerGUI
task.wait(3.5)
GUI.by.Visible = false
GUI.Frame.Visible = true
task.wait(4)
if not game:IsLoaded() then
game.Loaded:Wait()
end
wait(1.5)
TweenService:Create(GUI.Frame,
TweenInfo.new(0.5,
Enum.EasingStyle.Sine,
Enum.EasingDirection.Out
),
{Position=UDim2.new(0,0,1,0)}
):Play()
wait(1)
GUI:Destroy()
Controls:Enable()
StarterPlayer.CharacterJumpPower = 50
ingamegui.Enabled = true