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

How to make an unlock script inside a gui?

Asked by 8 years ago

Why is this not working? The other script is not disable what have to unlock Re-edit

local player = script.Parent.Parent.Parent -- find player
unlock = player.leaderstats.LevelName -- find leaderboard of player and value
unlockPoints = player.leaderstats.CoinsName -- find leaderboard of player and value
wait(2) --save wait
while true do
    wait(2)
    if unlock.Value >= 0 or unlockPoints >= 0 then -- checks if player is a higher value of the two leaderboards
        TT = script.TeleTo
        player.Character.Torso.CFrame = CFrame.new(TT.Value.X, TT.Value.Y, TT.Value.Z) -- teleport player
        script.Parent.MasterScriptEasy.Disabled = false -- Starting masterscript
    else
        if unlock.Value <= 25 or unlockPoints <= 200 then -- checks if player is a lower value of the two leaderboards
            script.Disabled = true -- turning of this script
        end
    end
end
-- This gui jumps in players when they join
0
Please explain your code, what it's doing, what it's intended to do, any variables that may cause it not to work. By the way, you need a wait in the while loop. M39a9am3R 3210 — 8y
0
Re Edited wintershopSab 10 — 8y

Answer this question