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

attempt to index field, a string value?

Asked by 5 years ago
Edited 5 years ago

For some reason in the output it said "Workspace.Map Generator:26: attempt to index field 'Value' (a string value)" for line 26 but when I had the basically the same line of code in other places and it worked fine. Here is the code:


local TopText = script.TopText while true do timer = 60 repeat timer = timer-1 TopText.Value = "Intermission ("..timer..")" wait(1) until timer == 0 TopText.Value = "Picking Random Map..." wait() m = game.Lighting.Maps:GetChildren() r = math.random(1,#m) map = m[r]:clone() map.Parent = workspace TopText.Value = "The Map Chosen Was "..map.Name.."!" local Spawn = map.Spawn wait(5) plrs = game.Players:GetChildren() for i = 1, #plrs do plrs[i].Character:MoveTo(map.Spawn.Spawn.Position+Vector3.new(math.random(-5,5),0,math.random(-5,5))) end wait() timer = 30 repeat timer = timer-1 TopText.Value.Text = ""..timer.." Seconds Until The Wall" wait(1) until timer == 0 Wall = game.ServerStorage.Wall:Clone() Wall.Parent = map Wall.Position = Spawn.Position map:remove() end

if you figure out the reason please tell and thank you to in advance if anyone finds the problem.

0
"TopText.Value.Text" change this to "TopText.Value" Imperialy 149 — 5y

1 answer

Log in to vote
1
Answered by
EteraW 77
5 years ago
Edited 5 years ago

You put .Value.Text so Text is not in the Value. Change it.

TopText.Value = ""..timer.." Seconds Until The Wall"
0
thank you kizi3000 88 — 5y
Ad

Answer this question