So I've been trying to make a gear gui where the play can put in an ID from the gear catalog to give them the gear they want. The problem is that whenever said player attempts to put in an ID, the output displays 'Unable to cast string to int64', and will not spawn in that item.
wait(1)
script.Parent.TextButton.MouseButton1Click:Connect(function()
local insertservice = game:GetService("InsertService")
local item = insertservice:LoadAsset(script.Parent.TextBox.Text)
item.Parent = workspace
end)
Any suggestions, tips, or explanations as to why my script isn't working is greatly appreciated!

1 comment
Is this suposed to give the player gear based on a id? If so try using this: tonumber("text here")