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

GUI turns invisible, but turns visible after you die?

Asked by 9 years ago

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

Log in to vote
0
Answered by
dyler3 1510 Moderation Voter
9 years ago

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

0
Thanks! PyccknnXakep 1225 — 9y
0
No prob. Always happy to help :P dyler3 1510 — 9y
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. PyccknnXakep 1225 — 9y
0
Ah, sorry about that. I just forgot to add a line in. It should work now I believe. dyler3 1510 — 9y
View all comments (3 more)
0
Still not working... have any idea? I might make a new post about this... PyccknnXakep 1225 — 9y
0
Hold on. I'll test it myself. If I find the problem I'll update my answer with a fix. dyler3 1510 — 9y
0
It works now! Thanks! PyccknnXakep 1225 — 9y
Ad

Answer this question