Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

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

Asked by 4 years ago
Edited 4 years ago

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

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

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)
0
Dev forum link? JesseSong 3916 — 4y
0
Wheres the dev forum for this. JesseSong 3916 — 4y
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 youtubemasterWOW 2741 — 4y
Ad

Answer this question