I have a game that lets you choose a power and battle other players with it. It's really simple, but for some reason, it still doesn't work. All in all the scripts combined hide all of the hotbars, then gives you a menu to select a power from.
Once you do, it finds the hotbar for that specific part and makes it visible. Then once the player dies it hides all hotbars and repeats the process. That's what it's supposed to do, but it does nothing. You can select your power but the hotbars don't change for some reason:
P.S. I get an error for line 12 of the main script saying: Died is not a valid member of Player "Players.PWTR1CK"
Main Script
local Menu = script.Parent
local Quirk = game.StarterGui.Quirk
local Player = game.Players.LocalPlayer
local Hotbars = game.Players.LocalPlayer.PlayerGui.PlayerGUI:GetChildren()
Hotbars.Visible = false
Menu.Visible = true
Quirk = nil
Player.Died:Connect(function()
Quirk = nil
Menu.Visible = true
Hotbars.Visible = false
end)
Button Script (that you click for your power)
local Menu = game.Players.LocalPlayer.PlayerGui.Menu.Frame
local Button = script.Parent
local Quirk = game.StarterGui.Quirk
Button.MouseButton1Click:Connect(function()
Menu.Visible = false
Quirk = Button.Text
local FindHotbar = game.Players.LocalPlayer.PlayerGui.PlayerGUI:FindFirstChild(Quirk)
if FindHotbar then
FindHotbar.Visible = true
end
end)

2 comments
I've changed it to exactly what you said and now I get this error: Humanoid is not a valid member of Model "Workspace.PWTR1CK"
Player.Character:WaitForChild("Humanoid"), that should work. Usually if you don't find the humanoid in a character that means the script ran too fast.