I need help. I don't know if I do this right. I'm trying to make this script work in a text button or image button. I'm trying to make the text button disappear, but its won't disappear, so what did I do wrong? Can you guys help me check some error that I made and give me feed back? Thank You.
local plyr = script.Parent.Parent.Parent.Parent.Parent.Parent wait(3) if plyr.Status2.Points.Value >= 20 then script.Parent:remove() elseif plyr.Status2.Lvl.Value <= 19 then print("yay") end
Is this the whole script? Because if it is, then you are missing tons of components. What exactly do you want to happen for it to disappear? You are trying to remove the text button when it is clicked? Why not make its property, visible, false? Here is what I think you want. Let me know if it works. The else statement is not needed either. Also, you do not have enough 'end' in your script. For every 'if' statement you need one end. Same for functions like the one I will post here below.
local plyr = script.Parent.Parent.Parent.Parent.Parent.Parent function onClick() wait(3) if plyr.Status2.Points.Value >= 20 then script.Parent.Visible = false print("yay") end end script.Parent.MouseButton1Click:connect(onClick)
I dont know the hierarchy of your script and all the other components to know if there is anything else wrong.