Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Unable to cast string to int64?

I have this script for an ife and I keep getting this error:

Unable to cast string to int64

Any help?

while script.Parent.Parent.Visible == true do
	local asset = game:GetService("MarketplaceService"):GetProductInfo(script.Parent.Parent.Song.SoundId)
	script.Parent.Text = asset.Name
	wait(.1)
end

2 comments

0

GetProductInfo only takes the numbers from the ID of the product, not the whole string assetID itself.

0

oof I meant script.Parent.Text = asset.Name but i still get the error

1 answer

✓ Accepted answer

getproductinfo needs to have a number input. infront of your number is "rbxassetid://". I havent tested it but i think it will work )

while script.Parent.Parent.Visible == true do
    local asset = game:GetService("MarketplaceService"):GetProductInfo(tonumber(script.Parent.Parent.Song.SoundId:sub(14)))
    script.Parent.Text = asset.Name
    wait(.1)
end

edit:

this code i tested and it worked:

local sid = "rbxassetid://685388224"
while script.Parent.Value.Value == true do
    local asset = game:GetService("MarketplaceService"):GetProductInfo(tonumber(sid:sub(14)))
    print(asset.Name)
wait(.1)
end

5 comments

0

since line 2 is long i recommend using "view source"

0

TYSM, enjoy your first rep xD

0

Actually I am getting "Argument 1 missing or nil" now.

0

what line?

0

I figured that out, thanks anyways.

This discussion is preserved as it was. New answers, comments, and votes are closed.