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
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)