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

attempt to index upvalue 'name' (a string value)?

Asked by 4 years ago

When my script executes I get the error attempt to index upvalue 'name' (a string value)

I'm not sure why I keep getting this error.

My Code

local code = script.Parent.Parent.View -- NumberValue
local name = script.Parent.Name -- TextGUI
local desc = script.Parent.Description -- TextGUI


        local val = code.Value
        local value = tostring(val)
        name.Text = Names["N".. value]
        desc.Text = Descriptions["D".. value]

1 answer

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

When you are trying to reference "Name" you are just indexing the Name property of script.Parent. To fix this you are going need to change the name of your TextGUI.

0
Thank you :) GreenBushed 13 — 4y
Ad

Answer this question