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

Show Gui when you kill someone? [Script Included]

Asked by
KAAK82 16
10 years ago
workspace.ChildAdded:connect(function(char)
if char:FindFirstChild"Humanoid" then
char.Humanoid.Died:connect(function()
if char.Humanoid:FindFirstChild("creator") then
char.Humanoid.creator.Value.PlayerGui.Killed.Frame.Visible = true
wait(3) char.Humanoid.creator.Value.PlayerGui.Killed.Frame.Visible = false 
end
end)
end
end)

I only want this to show up to the person who killed another Player, not both of them (the killer and the victim) cos its supposed to have a message for the killer...

0
Your tags make absolutely no sense. Do you even know what Pathfinding is? OniiCh_n 410 — 10y
0
lol sry, did the wrong one, got confused... KAAK82 16 — 10y
0
Two suggestions: 1, don't say "script included" in the question title, as this is a scripting website and that should be implied. 2, learn indentation style for scripting, it drastically improves readability GoldenPhysics 474 — 10y

1 answer

Log in to vote
0
Answered by 10 years ago
game.Players.PlayerAdded:connect(function(plr)
    plr.CharacterAdded:connect(function(char)
        char:WaitForChild("Humanoid").Died:connect(function()
            if char.Humanoid:FindFirstChild("creator") then
                local killer = game.Players:FindFirstChild(char.Humanoid.creator.Value)
                if killer == nil then return end
                killer.PlayerGui.Killed.Frame.Visible = true
                wait(3)
                killer.PlayerGui.Killed.Frame.Visible = false
            end
        end)
    end)
end)

This might work, it's un-tested

0
k, thnx KAAK82 16 — 10y
0
I wish I could test it now, but I need Players... and I needa go sleep now so I gotta sleep now and later test, thnx for it. even if it doesn't work then still, thnx for trying :D KAAK82 16 — 10y
0
Why was I down-voted for posting this? VariadicFunction 335 — 10y
0
I didn't DownVote, must have been someone else... :/ I UpVoted ;) KAAK82 16 — 10y
Ad

Answer this question