I went to clean up some of my scripts and i noticed a weird change in one of my local functions. For some reason my local function did not have an end, so I tried to add one. Instead I got "expected , got 'end'." I don't know why my script could work perfectly while the function could not even close, especially when the function was created outside of the event that it was used for. I just want cleaner scripts halp ;-;)
script that errors
local function GetItemInfo(Asset, Price)
Card.InfoBox.Header.ItemName.Text = Asset.Name
Card.ReXxInfoBox.Header.ItemName.Text = Asset.Name
Card.OutletInfoBox.Header.ItemName.Text = Asset.Name
Card.Creator.Text = Asset.Creator.Name
Card.Description.Text = Asset.Description
if Asset.PriceInRobux == nil then
Card.Price.Text = "Not for sale"
else
Card.Price.Text = Price.."R$"
end
if Asset.Creator.CreatorType == "Group" then
local GroupID = Asset.Creator.CreatorTargetId
Card.ItemImage.Image = game:GetService("GroupService"):GetGroupInfoAsync(GroupID).EmblemUrl
elseif Asset.Creator.CreatorType == "User" then
local Name = Asset.Creator.Name
Card.ItemImage.Image = ("http://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&Format=Png&username=%s"):format(Name)
end
end
end
same error script without statements
local function GetItemInfo(Asset, Price)
Card.InfoBox.Header.ItemName.Text = Asset.Name
Card.ReXxInfoBox.Header.ItemName.Text = Asset.Name
Card.OutletInfoBox.Header.ItemName.Text = Asset.Name
Card.Creator.Text = Asset.Creator.Name
Card.Description.Text = Asset.Description
end

3 comments
Whats the line 21 end for?
You have an extra end
Yeah, get rid of that end dude