How do I change the text of a textlabel to a variable using a script. The label is called tasksdoneamount and is in the file startergui—> screengui. I am very new to roblox scripting so I may not understand all the language. Go easy on me :)
COMMUNITY QUESTION
How to do textLabel text changing?
1 answer
Quite simple really.
-- Services
local playersService = game:GetService("Players)
-- Player
local player = playersService.LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")
local screenGui = playerGui:WaitForChild("ScreenGui")
local textLabel = screenGui:FindFirstChild("TextLabel")
textLabel.Text = "Hello World!"
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
You should use the answer @DevingDev gave you. But I'd also like to tell you that this is not a request site; try to do something before asking for help here
try to do script.Parent.TextLabel instead of game.StarterGui.ScreenGui.TextLabel
also put a LOCALSCRIPT inside the screenGui.