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

Attempt to get length of local 'Credits' (a userdata value)?

Asked by 6 years ago

Shortend version of the script:

local Credits = {"All:", "alphagamer150"}

local TextSpace = Instance.new("TextLabel", CreditsMenu)
TextSpace.BackgroundTransparency = 1
TextSpace.Size = UDim2.new(1, 0, 0.9, 0)
TextSpace.TextSize = 16
TextSpace.TextXAlignment = Enum.TextXAlignment.Left
TextSpace.TextYAlignment = Enum.TextYAlignment.Top

local Text
for i = 1, #Credits do
    Text = Text .. Credits[1] .. "nl/"
end

TextSpace.Text = Text

The code above is giving this error: 09:50:13.522 - Players.alphagamer150.PlayerScripts.MainMenu:79: attempt to get length of local 'Credits' (a userdata value)

I don't know anything else.

0
i'd just use for k in pairs(Credits) do Text = Text ..k.. "\n" RubenKan 3615 — 6y
0
Somewhere in the full script you set Credits to a userdata value. pls don't post useless short versions. cabbler 1942 — 6y
0
ok AlphaGamer150 101 — 6y

Answer this question