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

How do I display a NumberValue on a SurfaceGUI?

Asked by 3 years ago
Edited 3 years ago

I'm making a gameshow and wanted the stands where the contestants are to have their points displayed. I made the stands and added a simple Surface GUI and TextLabel. Then inside the TextLabel, I added this local script code, but it didn't work.. Please help.

while wait(0.01) do

script.Parent.Text = workspace.Model.Sign.Value

end
0
What is the error Jackmods_YT -12 — 3y
0
The text on the SurfaceGUI wouldn't show up WhatsSamYT 9 — 3y
0
Please use a code block for your code. 2_MMZ 1059 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

Use tostring. The NumberValue is a Number, and the "Text" property of the TextLabel is a string.

while wait(0.01) do
    script.Parent.Text = tostring(workspace.Model.Sign.Value)
end
0
Squidiskool, I tried your suggestion, but the SurfaceGUI still appears blank. WhatsSamYT 9 — 3y
0
Does workspace.Model.Sign.Value exist? squidiskool 208 — 3y
0
Squidiskool, yeah, I have the model in the workspace and in the model is the sign. In the sign there is a value and surfaceGui. In the surfaceGUI there is a Textlabel and the localscript WhatsSamYT 9 — 3y
0
This won't work on a localscript. squidiskool 208 — 3y
View all comments (3 more)
0
Also is "Sign" a value? Is "Value" a value? If so then put .Value after Value. squidiskool 208 — 3y
0
no only value is a value WhatsSamYT 9 — 3y
0
ok i changed it from a localscript to a normal script and it works now! thanks squidiskool! WhatsSamYT 9 — 3y
Ad

Answer this question