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

Hello! I'm trying to change the text of the textlabel depending on the value?

Changing the text works its when i add something it gives me an error. Script 1:

while script.Parent.Name == "PlayerCount" do
	local Text  = script.Parent.PlrCount.Value
	script.Parent.Text = Text
end

Script 2:

function Touched()
	local value = workspace.PlrCount1.BillboardGui.PlayerCount.PlrCount
	workspace.PlrCount1.BillboardGui.PlayerCount.Value = value.Value + 1
end
script.Parent.Touched:Connect(Touched)

The error is Value is not a valid member of TextLabel

2 answers

✓ Accepted answer

The error is in the first script that you sent. You can not store a value's value inside the variable, instead you must do

local testValue = script.Parent.exampleValue --example
print(testValue.Value)

In your case it will be

while script.Parent.Name == "PlayerCount" do
    local Text  = script.Parent.PlrCount
    script.Parent.Text = Text.Value
end

Please accept my answer if it works!

2 comments

0

Im getting the same error

0

nvm it worked

Try to do something like

if value == 1 then
script.Parent.Text = text

This discussion is preserved as it was. New answers, comments, and votes are closed.