How do I make text in a TextLabel update based on a variables?

local module = require(game.ReplicatedStorage.variables
.moduleName
)
local variable = module.theVariable --theVariable is a variable stored in a module script.
textLabel = script.Parent

while true do
wait(0.1)
textLabel.Text = variable
end
i have tried using tostring()

is this in a local script or server script? Do you use Actors in your game?

I know you’ve tried tostring() but try this.

local module = require(game.ReplicatedStorage.variables.moduleName)
local variable = module.theVariable -- theVariable is a variable stored in a module script.
local textLabel = script.Parent

-- Use a RenderStepped connection for continuous updates
game:GetService("RunService").RenderStepped:Connect(function()
    textLabel.Text = tostring(variable)
end)

it’s in a local sceript inside a text label. i dunno what an actor is.