Why is this script not showing the text?

I have a script that is supposed to update the text on a label but its not working. Need help. Script:

local Variables = require(script.Parent.Parent.Parent.Parent.ServerScriptService.Variables)
while true do
script.Parent.Text = "Infections:"..Variables.Infections
wait(3)
end

All help appreciated.

Show your module script (Atleast part with an infections)
(Also you can do game:GetService(“ServerScriptService”).Variables instead)

Since you’re trying to manipulate text, i’m assuming this is a localscript? If so, clients don’t have access to ServerScriptServices

1 Like

Two issues:

There’s no need to use excessive amounts of .Parent when you can identify ServerScriptService using game.ServerScriptService.

Since you are trying to manipulate text here I can only imagine this is being run in a local script, however if not it’s likely that something in the Variables module script is causing a yield, seeing that source code would be very beneficial.

1 Like

Assuming Infections is a Number/Int value, you’ll need to add .Value to the end of line 3 to access its value.

Also, the answers above are all very useful.

Trying all these now-
(30 chars)