hello I trying to make a unlocking system that when the player reach the amount of level that will unlock the gui button, but I don’t know how would the script go about. this is the script that i tried to made by my self.
local players = game:GetService("Players")
local player = players.LocalPlayer
local gui = player.PlayerGui["stats system"]["menu system"].menu["co op system"]
local open = player.PlayerGui["stats system"]["menu system"].menu["co op"]
local xp = Instance.new("IntValue", player)
xp.Name = 'Exp'
xp.Value = 0
local level = Instance.new("IntValue", player)
level.Name = 'level'
level.Value = 0
local leaderstats = game.Players:WaitForChild('leaderstats')
game.Players.PlayerAdded:Connect(function(player)
while level.Value >= 1 do --value required
player.PlayerGui["stats system"]["menu system"].menu["co op"].Visible = true
if player.PlayerGui["stats system"]["menu system"].menu["co op"].visbile == false then
repeat until -- repeat until the gui visible = true
player.PlayerGui["stats system"]["menu system"].menu["co op"].Visible == true
end
end
end)
local players = game:GetService("Players")
local player = players.LocalPlayer
local gui = player.PlayerGui["stats system"]["menu system"].menu["co op system"]
local open = player.PlayerGui["stats system"]["menu system"].menu["co op"]
local xp = Instance.new("IntValue", player)
xp.Name = 'Exp'
xp.Value = 0
local level = Instance.new("IntValue", player)
level.Name = 'level'
level.Value = 0
local leaderstats = game.Players:WaitForChild('leaderstats')
game.Players.PlayerAdded:Connect(function(player)
level.Changed:Connect(function(value)
if level.Value >= 1 then --value required then
player.PlayerGui["stats system"]["menu system"].menu["co op"].Visible = true
end
end
end)
local player = game.Players.LocalPlayer
local open = player.PlayerGui["stats system"]["menu system"].menu["co op"]
local level = player.leaderstats.level
level.Changed:Connect(function(value)
if level.Value >= 1 then
open.Visible = true
end
end)