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

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

Asked by 8 years ago
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 :)

0
Can you provide the line #, and if you updated your code could you please update that aswell so we can help? :) Azmidium 388 — 8y
0
Line 13, and i didnt update my code yet UnknownGenerations 10 — 8y

1 answer

Log in to vote
1
Answered by 8 years ago

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

0
thanks so much! UnknownGenerations 10 — 8y
Ad

Answer this question