Hello, I am trying to make a script that appears or disappears uis.
I made this code in a LocalScript in starterplayerscript
I get this error FirstFrame is not a valid member of PlayerGui “Players.anakin67001.PlayerGui”
I’ll give you the screenshots and the
local Players = game:WaitForChild("Players")
local player = Players.LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")
local blur_effect = game.Lighting.Blur
local function setupUI(buy, info_frame, buy_frame, Back_boutton)
buy.MouseButton1Click:Connect(function()
blur_effect.Enabled = true
info_frame.Visible = false
buy.Visible = false
buy_frame.Visible = false
wait(1)
blur_effect.Enabled = false
Back_boutton.Visible = true
end)
end
local Etape1 = playerGui.FirstFrame.Frame
local buy_frame1 = playerGui.Frame.Claim
local Back_boutton1 = playerGui.Frame.Back
setupUI(Etape1, buy_frame1, Back_boutton1)
local buy2 = playerGui.SecondUI.Buy
local info_frame2 = playerGui.SecondUI.InfoFrame
local buy_frame2 = playerGui.SecondUI.BuyFrame
local Back_boutton2 = playerGui.SecondUI.BackButton
setupUI(buy2, info_frame2, buy_frame2, Back_boutton2)
Thanks