Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

¿How can i change the text in a TextLabel or other intance of text?

Asked by 4 years ago

Hello, I am trying change the text of a TextLabel dependant the Health of the humanoid.

I tried whith that script:

while true do
    local label = script.Parent
    local label.Text = script.Parent.Text
    local labelText == game.Players.LocalPlayer.Character.Humanoid.Health
end

¿what's wrong?

1 answer

Log in to vote
0
Answered by 4 years ago
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer

local TextLabel = script.Parent

while wait() do
    TextLabel.Text = LocalPlayer.Character.Humanoid.Health
end

Your issue is that you're using incorrect variable naming. [Line 3]

I hope this fixes your issue.

Ad

Answer this question