Locked levels GUI

Hello everyone !
I would like to know how could I make these levels buttons locked until the player step on the checkpoint of the level.

I don’t know how to make and where to start with ! A bit of help would be appreciated !

Try this example script here:

--Local script, paste inside the frame which contains the buttons
local player = game.Players.LocalPlayer
local ls = player.Leaderstats
local buttons = {script.Parent.ButtonLevel1, script.Parent.ButtonLevel2, script.Parent.ButtonLevel3} -- Rename and add more if you like.
for _,v in pairs(buttons) do
   v.MouseButton1Down.Connect:function()
      if tonumber(v.Text) > ls.Level.Value then
            print("denied")
         else
            print("accepted")
      end
   end
end

Hope this helps :wink:

2 Likes