You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
Hello fellas, basically I want the screengui created by using the instance to be destroyed after the entire script finishes running, doesn’t seem to be working no matter what I try though, am I missing something?
It’s supposed to act like a sort of loading screen for each player that joins the game!
local StarterGui = game:FindFirstChild("StarterGui")
local SoundService = game:FindFirstChild("SoundService")
local DoorOpenAndClose = SoundService.Door
local Footsteps = SoundService.Footstep
Here's the script! :
game.Players.PlayerAdded:Connect(function(player)
print(player.Name.." has joined")
local BlackScreen = Instance.new("ScreenGui")
BlackScreen.Enabled = true
BlackScreen.Parent = StarterGui
BlackScreen.IgnoreGuiInset = true
StarterGui:WaitForChild("ScreenGui")
local BlackScreenFrame = Instance.new("Frame")
BlackScreenFrame.Size = UDim2.new(0,1378,0,680)
BlackScreenFrame.Active = true
BlackScreenFrame.Parent = BlackScreen
BlackScreenFrame.BackgroundColor3 = Color3.fromHSV(0, 0, 0)
Footsteps:Play()
Footsteps.Ended:Wait()
DoorOpenAndClose:Play()
DoorOpenAndClose.Ended:Wait()
end)
I appreciate any type of help!