Hello! So I am working on a skip cutscene button and its not working? It will not print the message even though its the right amount.
script and not a localscript:
local Debouce3 = false
local Debouce4 = false
local TotalPlayers = #game:GetService("Players"):GetPlayers()
script.Parent.Parent.SkipButton.MouseButton1Click:Connect(function()
if Debouce3 == false then
Debouce3 = true
script.Parent.Parent.Skips.Value = script.Parent.Parent.Skips.Value + 1
end
end)
while wait(0.1) do
script.Parent.Parent.SkipButton.Text = "Skips("..script.Parent.Parent.Skips.Value.."/"..TotalPlayers..")"
if script.Parent.Parent.Skips.Value == TotalPlayers then
print("works")
end
end
you should update the variable and maybe inside the loop:
local Players = game:GetService("Players")
local TotalPlayers = #Players:GetPlayers()
while task.wait(0.1) do
TotalPlayers = #Players:GetPlayers()
script.Parent.Parent.SkipButton.Text = "Skips("..script.Parent.Parent.Skips.Value.."/"..TotalPlayers..")"
if script.Parent.Parent.Skips.Value == TotalPlayers then
print("works")
end
end