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