You’re setting the value back to 300 every time the loop is called
Try this
local text = script.Parent
local value = game.Workspace.Value
value.Value = 300
while true do
text.Text = value.Value
wait(1)
value.Value = value.Value - 1
end
You don’t need to reference it inside the TextLabel as that’ll change for every player that joins the game, the way you have it now is that if this is a ServerScript, the value will change in different intevals depending on how much players there are
You could just put the value inside ReplicatedStorage, leave the changing script inside ServerScriptService, and put a LocalScript in the TextLabel to detect when the Value gets changed:
--Server Script
local Value = game.ReplicatedStorage:WaitForChild("Value")
Value.Value = 300
while wait(1) do
script.Parent.Text = tostring(Value.Value)
Value.Value -= 1
end
--LocalScript inside the TextLabel
local TextLabel = script.Parent
local Value = game.ReplicatedStorage:WaitForChild("Value")
Value.Changed:Connect(function(NewValue)
TextLabel.Text = tostring(NewValue)
end)