Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to do textLabel text changing?

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 :)

3 comments

0

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

0

try to do script.Parent.TextLabel instead of game.StarterGui.ScreenGui.TextLabel

0

also put a LOCALSCRIPT inside the screenGui.

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.