Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

I need help fixing my gui script i made for my loading screen (more info in desc)?

So i have made a loading screen were when you press play, a black loading screen will come up for 3 seconds as it is loading in.

For some reason, my script doesnt work. I am quite new to scripting so can someone please help!

local Camera = game.Workspace.CurrentCamera


script.Parent.MouseButton1Click:Connect(function()
	Camera.CameraType = "Custom"
	script.Parent.Parent.Donate.Visible = false
	script.Parent.Parent.Logo.Visible = false
	script.Parent.Visible = false
	game.StarterGui.RobloxBlackScreen.Frame.Visible = true
	wait(3)
	game.StarterGui.RobloxBlackScreen.Frame.Visible = false
end)

anything will help

RobloxBlack screen is my black loading screen and it is in a different screen gui to my other buttons

1 answer

✓ Accepted answer

You have to set the CameraType using an Enum, and you have to get the gui from a player's PlayerGui. Also, make sure the script is a LocalScript, and place it in ReplicatedFirst. Try using this: Make sure you transfer the gui too.

local camera = game:GetService("Workspace").CurrentCamera
local player = game:GetService("Players").LocalPlayer
local cloneGui = player:WaitForChild("PlayerGui"):WaitForChild("RobloxBlackScreen"):Clone()


script.Parent.MouseButton1Click:Connect(function()
	camera.CameraType = Enum.CameraType.Custom
	script.Parent.Parent:WaitForChild("Donate").Visible = false
	script.Parent.Parent:WaitForChild("Logo").Visible = false
	script.Parent.Visible = false
	cloneGui:WaitForChild("Frame").Visible = true
	wait(3)
	cloneGui:WaitForChild("Frame").Visible = false
end)

3 comments

0

Dev forum link?

0

Wheres the dev forum for this.

0

I didn't use the Dev Forums, but here's an article I found https://developer.roblox.com/en-us/articles/Custom-Loading-Screens

This discussion is preserved as it was. New answers, comments, and votes are closed.