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

Why am I keep getting this "index upvalue" error?

local robox = script.Parent.Parent.Parent
local robloxrunner = script.Parent.RobloxRunner
local gamedesc = script.Parent.Parent.GameDesc
local play = gamedesc.Play
local name = gamedesc.Name
local desc = gamedesc.Desc
local close = gamedesc.Close

robloxrunner.MouseButton1Down:connect(function()
	gamedesc.Visible = true
	script.Parent.All.Visible = false
	
	name.Text = "Roblox Runner"
	desc.Text = "Run as fast as you can to escape each level.  You only have 3 lives per level, so be careful!  Collect coins along the way to get awesome upgrades!"
end)

-----------------------------------------------------------------------------------------------------------------------------
local function close()
		gamedesc.Visible = false
		script.Parent.All.Visible = true
	end
	
close.MouseButton1Down:connect(close)

local function play()
		gamedesc.Visible = false
		script.Parent.Parent.Visible = false
		robox.GamesList.RobloxRunner.Visible = true
end

 play.MouseButton1Down:connect(play)

When I click the button, this error shows: "attempt to index upvalue 'name' (a string value)"

Help would be very much appreciated, thanks :)

2 comments

0

Can you provide the line #, and if you updated your code could you please update that aswell so we can help? :)

0

Line 13, and i didnt update my code yet

1 answer

✓ Accepted answer

name is gameDesc.Name, which is a string value. This means that when you try name.Text, it flips out. If Name is a child of gameDesc, you should consider using FindFirstChild

1 comment

0

thanks so much!

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