the reason why it isnt working is because the if value only checks the conditions once, so unless you have a loop or something like that, it will not check, you can use .Changed so that the script runs whenever the value changes, or you can do either while true do with task.wait(), or while task.wait() do to make it loop forever (you can put in a number in task.wait() if you want it to check every so often. i cant really explain stuff so sorry about that
Always Trigger Option
local player = game.Players.LocalPlayer
local points = player:WaitForChild("leaderstats"):WaitForChild("Points")
local wins = player:WaitForChild("leaderstats"):WaitForChild("Wins")
local Team = game:GetService("Teams")
while true do
if player.Team.Name == "Red Team" then
If points.Value == 4 then
wins.Value = wins.Value + 1
player:WaitForChild("PlayerGui"):WaitForChild("RedTeamWins").Frame.Visible = true
end
end
task.wait()
end
Change (In Seconds) How Long It Takes To Trigger Option
local player = game.Players.LocalPlayer
local points = player:WaitForChild("leaderstats"):WaitForChild("Points")
local wins = player:WaitForChild("leaderstats"):WaitForChild("Wins")
local Team = game:GetService("Teams")
while task.wait() do
if player.Team.Name == "Red Team" then
If points.Value == 4 then
wins.Value = wins.Value + 1
player:WaitForChild("PlayerGui"):WaitForChild("RedTeamWins").Frame.Visible = true
end
end
end
Triggers When Value Is Changed Option
local player = game.Players.LocalPlayer
local points = player:WaitForChild("leaderstats"):WaitForChild("Points")
local wins = player:WaitForChild("leaderstats"):WaitForChild("Wins")
local Team = game:GetService("Teams")
points.Changed:Connect(function()
if player.Team.Name == "Red Team" then
If points.Value == 4 then
wins.Value = wins.Value + 1
player:WaitForChild("PlayerGui"):WaitForChild("RedTeamWins").Frame.Visible = true
end
end
end)