Hi Developers,
Currently I’ve issues with the following GUI.
I’m trying to do it like once the Blur is destroyed then the ScreenGUI will appear. But somehow it’s not working and I tried to look at YouTube and nothing is there.
Best regards,
Dev_Cron.
Error/output:
In Explorer:
Script:
screenGui.IgnoreGuiInset = true
screenGui.Enabled = true
local Player = game.Players.LocalPlayer
local blur = Instance.new("BlurEffect",game.Workspace.CurrentCamera)
local Camera = workspace.CurrentCamera
local CameraPart = game.workspace.CameraPart
local Camera1 = game.workspace.Camera1
local Character = Player.Character or Player.CharacterAdded:Wait()
local Camera2 = game.Workspace.Camera2
local ScreenGUI = script.Parent.Parent.ScreenGui
ScreenGUI.Enabled = false
repeat wait()
Camera.CameraType = Enum.CameraType.Scriptable
until Camera.CameraType == Enum.CameraType.Scriptable
Camera.CFrame = workspace.CameraPart.CFrame
wait(0.1)
Camera:Interpolate(Camera1.CFrame, CameraPart.CFrame, (Player.Character.Head.Position - Camera1.Position).magnitude * 0.1)
local bg = screenGui:WaitForChild("Background")
blur.Size = 25
local logo = bg:WaitForChild("Logo")
local uiGradient = logo:WaitForChild("UIGradient")
wait(01)
Camera:Interpolate(Camera2.CFrame, Camera1.CFrame, (Player.Character.Head.Position - Camera2.Position).magnitude * 0.1)
local playBtn = bg:WaitForChild("PlayButton")
local hasClickedPlay = false
playBtn.Position = UDim2.new(0.5, 0,1, 0)
uiGradient.Offset = Vector2.new(0, 0)
local tweenService = game:GetService("TweenService")
local tweenInfoFade = TweenInfo.new(6, Enum.EasingStyle.Quint, Enum.EasingDirection.InOut)
local tweenInfoHover = TweenInfo.new(0.2, Enum.EasingStyle.Quint, Enum.EasingDirection.InOut)
local fadeInTween = tweenService:Create(uiGradient, tweenInfoFade, {Offset = Vector2.new(0, -1)})
fadeInTween:Play()
fadeInTween.Completed:Wait()
wait(0.2)
playBtn:TweenPosition(UDim2.new(0.5, 0,0.741, 0), "Out", "Elastic", 1)
wait(1)
playBtn.MouseButton1Click:Connect(function()
if hasClickedPlay then return end
hasClickedPlay = true
playBtn:TweenPosition(UDim2.new(0.5, 0, -1, 0), "In", "Elastic", 1)
wait(2)
bg:TweenPosition(UDim2.new(0.5,0 , -1, 0), "In", "Elastic", 1)
wait(2)
Camera.CameraType = Enum.CameraType.Custom
bg.Parent:Destroy()
blur:Destroy()
end)