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

Very simple script can't change values?

Asked by 5 years ago
Edited 5 years ago
script.Parent.Value = "Voltison     -    Augusta ME" 

That's literally the entire script. Not even kidding. And it doesn't work. The script's parent is the value in question. The value is a StringValue. ?????

FE is enabled if that changes anything.

0
what are you trying to achieve, exactly? I think the value if it's a string value would literally be "Voltison - Augusta ME". If you're trying to get the value as a value of a difference between two numbers, that's not how you do it, because of the quotation marks. ScrubSadmir 200 — 5y
0
I'm trying to get the game to, when it is launched, make the StringValue "Voltison - Augusta ME" I can't just make the value that to begin with because when more cities are constructed I'll need a system to do that, I don't want all the jobs going to one place. sesamert16 31 — 5y
0
Type of script? StringValue's parent? Rare_tendo 3000 — 5y
0
It's a regular script. The value's parent is a TextButton, whose parent is Frame, whose parent is a ScreenGui. sesamert16 31 — 5y
View all comments (4 more)
0
how exactly did you figure out that the value is not changing? did you personally go through studio explorer and checked the value or did you look at the textbutton's text or what? Astralyst 389 — 5y
0
Yep. There is nothing in the Value property of the StringValue. sesamert16 31 — 5y
0
Normal scripts won't work in PlayerGui, so you'll have to use a local script Rare_tendo 3000 — 5y
0
I changed it to a localscript, still nothing. sesamert16 31 — 5y

2 answers

Log in to vote
0
Answered by 5 years ago

is script inside of string value?

script should be parent in StringValue

if script.Parent.Value == "ANY text here" then -- this text should be in string value script.Parent.Value = "Ur text here" -- changes from text "ANY text here" to "Ur text here" end

0
The value didn't change from "T" (the text I put in as "ANY text here) to Voltison - Augusta ME. Weird - that should have worked. MY script should've worked too. Idk what's going on here. sesamert16 31 — 5y
Ad
Log in to vote
0
Answered by 5 years ago

I have 2 things that could be wrong: 1. script is disabled 2. you might be targeting the wrong thing. for example:

script.Parent.Text = 'your string'

it is also to note the parent is the textbutton, not the stringvalue. the string value is pointless in this case.

Answer this question