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

Gui displayer on death doesn't work ?

i made this script when player dies makes gui appear but it doesn't. At first it worked but when i changed my gui location it doesn't work and it broke.. -.- i tried onDie functions did not work either...

this is how my setup looks: http://prntscr.com/8b2mqw

Player = script.Parent.Parent.Parent.Parent.Parent.Character
s = Player.Humanoid

while true do

if s.Health <= 0 then
script.Parent.Wasted01.Visible = true
script.Parent.Wasted02.Visible = true
wait(2.50)
script.Parent.Visible = true

end
wait()
end

help da noob plz

2 answers

✓ Accepted answer

Lego almost had it correct, but he made the mistake of using 'Character' as a descendant of Player. This won't work because 'Character' is actually a property.


So, to fix that, we'll simply change it up to this (In a LocalScript):

repeat wait() until game.Players.LocalPlayer.Character --Makes sure that the Character is loaded in.
game.Players.LocalPlayer.Character.Humanoid.Died:connect(function()
	script.Parent.Parent["Wasted01"].Visible = true
	script.Parent.Parent["Wasted02"].Visible = true
	wait(2.50)
	script.Parent.Visible = true
end)

And there you go. That's all he missed.


Don't forget to upvote Lego's answer, since I used and edited his script. If you have any further problems/questions, please leave a comment below. Hope I helped :P

####-Dyler3

Try this (In a local script)

game.Players.LocalPlayer :WaitForChild("Character").Humanoid.Died:connect(function()
		script.Parent.Parent["Wasted01"].Visible = true
		script.Parent.Parent["Wasted02"].Visible = true
		wait(2.50)
		script.Parent.Visible = true
end)

5 comments

0

Nope, doesn't work.

0

Just looked at your setup, you had the wrong amount of "Parent", I updated the answer.

0

Oh yeah, always forget XD

0

Lol, it's cool, I upvoted.

0

Thanks to you both...

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