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

How To Make A GUI That Unlock Character For Point?

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

1 answer

✓ Accepted answer

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.

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