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

GUI turns invisible, but turns visible after you die?

Location:click me

So I created this very very simple script,

wait(60)
script.Parent.TextColor3 = Color3.new( 255,0,0 )
script.Parent.Text = "[ BOSS FIGHT ] Is starting"
wait(2)
script.Parent.Text = "[ WARNING ] Boss fight is about to begin!"
wait(3)
script.Parent.Parent.Parent.wrathometer.Visible = false

And it works after all the time is up, but when you die it shows up again even if its not visible? Can I have some help or improvements to this script?

1 answer

✓ Accepted answer

##Updated And Tested


I think I might have a fix for you. Change it to a Localscript, and try inserting this into it:

Player=game.Players.LocalPlayer --Gets the LocalPlayer

if not Player:FindFirstChild("Visibility") then --Sets up a value that lets the game know to make it visible or not
    Bv = Instance.new("BoolValue",Player)
    Bv.Name = "Visibility"
    Bv.Value = true
end

if Player:FindFirstChild("Visibility").Value == false then
    script.Parent.Parent.Parent.wrathometer.Visible = false
else
    wait(60)
    script.Parent.TextColor3 = Color3.new( 255,0,0 )
    script.Parent.Text = "[ BOSS FIGHT ] Is starting"
    wait(2)
    script.Parent.Text = "[ WARNING ] Boss fight is about to begin!"
    wait(3)
    script.Parent.Parent.Parent.wrathometer.Visible = false
    Player:FindFirstChild("Visibility").Value = false
end

Anyways, the script should work now. Basically, what I did is inserted a value into the player, and whenever the player dies and the script runs again, it checks if the value is true or not, and sets the visiblity depending on that.


Anyways, I hope this makes sense and helped you out a bit. If not or if you have any further problems/questions, please leave a comment below :P


###• It should definitely work now. I have tested it to make sure it does, so if it still isn't working, then something must be wrong with the way you have it settup. Make sure it's in a LocalScript, and everything should work fine

7 comments

0

Thanks!

0

No prob. Always happy to help :P

0

@Dyler3 for some reason its not working. Can you resolve the issue? The text isnt changing and I got a red error in the error box.

0

Ah, sorry about that. I just forgot to add a line in. It should work now I believe.

0

Still not working... have any idea? I might make a new post about this...

0

Hold on. I'll test it myself. If I find the problem I'll update my answer with a fix.

0

It works now! Thanks!

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