This script is in a script. It tests if the leaderstats Quest Value is 0 if its true then it will enable the script.
local players = game.Players:children() while wait(.1) do if players.leaderstats.Quest.Value == 0 then script.Parent.Disabled = false else script.Parent.Disabled = true end end
local players = game.Players:GetChildren() while wait(.1) do if players.leaderstats.Quest.Value == 0 then script.Parent.Disabled = false else script.Parent.Disabled = true end end
Try this:
local players = game.Players:GetChildren() while true do wait(.1) for index, player (players) do if player.leaderstats.Quest.Value == 0 then script.Parent.Disabled = false else script.Parent.Disabled = true end end
Or this:
local players = game.Players:GetPlayers() while wait(.1) do for i=1,#players do if players[i].leaderstats.Quest.Value == 0 then script.Parent.Disabled = false else script.Parent.Disabled = true end end end