Made a class selection screen, I have health bars and stuff so I made them visible = false. But when you choose your class I made my script make them visible (The health bars and stuff) Even though it says it is visible, you cant see the bars. (And yes the ZIndex is higher)
During selection: (The bars is that square thing)
After selection:
As you can see, gone.
This is the script:
local MainFrame = script.Parent.MainFrame
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Event = ReplicatedStorage.ClassChosen
local Vampire = MainFrame.Vampire
local Human = MainFrame.Human
local VampireInfo = MainFrame.VampireInfo
local HumanInfo = MainFrame.HumanInfo
local Player = game:GetService("Players").LocalPlayer
local HumanClass = Player:WaitForChild("Classes"):WaitForChild("Human")
local VampireClass = Player:WaitForChild("Classes"):WaitForChild("Vampire")
local MainFrame2 = game:GetService("StarterGui").Bars.MainFrame
Vampire.MouseButton1Click:Connect(function()
local VampireChosen = "Vampire"
Event:FireServer(VampireChosen)
MainFrame.Visible = false
MainFrame2.Visible = true
end)
Human.MouseButton1Click:Connect(function()
local HumanChosen = "Human"
Event:FireServer(HumanChosen)
MainFrame.Visible = false
MainFrame2.Visible = true
end)
Vampire.MouseEnter:Connect(function()
VampireInfo.Visible = true
end)
Human.MouseEnter:Connect(function()
HumanInfo.Visible = true
end)
Vampire.MouseLeave:Connect(function()
VampireInfo.Visible = false
end)
Human.MouseLeave:Connect(function()
HumanInfo.Visible = false
end)