Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Show Gui when you kill someone? [Script Included]

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...

3 comments

0

Your tags make absolutely no sense. Do you even know what Pathfinding is?

0

lol sry, did the wrong one, got confused...

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

1 answer

✓ Accepted answer
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

4 comments

0

k, thnx

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

0

Why was I down-voted for posting this?

0

I didn't DownVote, must have been someone else... :/ I UpVoted ;)

This discussion is preserved as it was. New answers, comments, and votes are closed.