This code isnt working for some reason. No error. its supposed to change the text of a gui to the value of a string value every time the value is changed.
local Status = script.Parent.Status local Player = script.Parent.Parent.Parent.Parent local StatusVal = game.Workspace.GameV2.Status.Value while true do Status.Text = StatusVal end)
As Rexbit said, you neep a wait in your loop and i also think you should have a >WaitForChild("")< so that it works online. Hope I helped
local Status = script.Parent:WaitForChild("Status") local Player = script.Parent.Parent.Parent.Parent local StatusVal = game.Workspace.GameV2.Status StatusVal.Changed:connect(function(value) Status.Text = value end)
In loops, a wait
is always needed, otherwise the studio will crash. Another point-out, a loop continues looping, never to stop unless broken up by a break
, thus preventing the loop to update it's current code within.
local Status = script.Parent.Status local Player = script.Parent.Parent.Parent.Parent local StatusVal = game.Workspace.GameV2.Status StatusVal.Value.Changed:connect(function(value) Status.Text = value end)