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

Gui displayer on death doesn't work ?

Asked by
Bulvyte 388 Moderation Voter
8 years ago

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

Log in to vote
2
Answered by
dyler3 1510 Moderation Voter
8 years ago

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

Ad
Log in to vote
1
Answered by
ItsMeKlc 235 Moderation Voter
8 years ago

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)

0
Nope, doesn't work. Bulvyte 388 — 8y
0
Just looked at your setup, you had the wrong amount of "Parent", I updated the answer. ItsMeKlc 235 — 8y
0
Oh yeah, always forget XD ItsMeKlc 235 — 8y
0
Lol, it's cool, I upvoted. dyler3 1510 — 8y
0
Thanks to you both... Bulvyte 388 — 8y

Answer this question