Why won't the screen Gui pop up?

Hello! So what I am trying to do is make a boss health bar appear when a player touches a block. Everything looks fine, but the Gui will not pop up. The children of the gui are visible. What is wrong?

script.Parent.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") then
        game.Workspace.Text.Value = 7
    game.StarterGui.Kool.Enabled = true
    end
end)

If you have questions, please ask!

When game loads the StarterGui gets cloned in the player’s PlayerGui. So changing the property in StarterGui would just change the StarterGui that the player would have when they respawn. Try getting the player then enabling the gui by getting the PlayerGui from the player object.

1 Like

Yeah. Try using this:

PARTHERE.Touched:Connect(function(hit)
    local player = game.Players:GetPlayerFromCharacter(hit.Parent) -- sees if the character (hit.Parent) is a player's character, if so, then it returns the player
    if player then
        game.Workspace.Text.Value = 7
        player.PlayerGui.Kool.Enabled = true
    end
end)
2 Likes

You should be changing anything with UI’s locally. I suggest firing a remote event.