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

attempt to concatenate field 'Value' (a userdata value)?

Asked by 5 years ago

Bi\HighestBidder is actually a ObjectValue on workspace and this script is inside a text label.

Error appears on line 6

local Bidder = workspace.HighestBidder

script.Parent.Text = "Highest Bidder: Nobody"

Bidder.Changed:Connect(function()
    script.Parent.Text = "Highest Bidder: "..Bidder.Value
end)

1 answer

Log in to vote
0
Answered by
mattscy 3725 Moderation Voter Community Moderator
5 years ago

Your value is most likely an ObjectValue, and thus stores a string rather than an object (which is considered UserData). To solve this, you can either store the bidder's in a StringValue in the first place, or just add .Name at the end of the line:

local Bidder = workspace.HighestBidder

script.Parent.Text = "Highest Bidder: Nobody"

Bidder.Changed:Connect(function()
    script.Parent.Text = "Highest Bidder: "..Bidder.Value.Name
end)
0
Thanks! Worked! SuperBeeperman 30 — 5y
Ad

Answer this question