Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Follow up question on a script that if a player is killed it shows a GUi?

Asked by 6 years ago

So this is a follow up. I'm trying to see if there is a way when a player dies it shows a GUI this is what I have so far~~~~~~~~~~~~~~~~~ local player = game.Players.LocalPlayer game:GetService('Players').LocalPlayer:WaitForChild('PlayerGui') player.Character.Humanoid.Died:connect(function() player.PlayerGui.skipques.question.Visible = true end) ~~~~~~~~~~~~~~~~~

1 answer

Log in to vote
0
Answered by 6 years ago

Your code should be like this. Also, you need to put the script bellow into a Script in ServerScriptService

Code:

game:GetService('Players').PlayerAdded:connect(function(player)
    player.CharacterAdded:connect(function(character)
        character:WaitForChild("Humanoid").Died:connect(function()
            player.PlayerGui:WaitForChild("skipques"):WaitForChild("question").Visible = true
        end)
    end)
end)
Ad

Answer this question