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

Unable to cast Instance to int64 what does this mean?

Asked by 4 years ago
Edited 4 years ago
        if SoundIdInputFrame == nil then

            local GID = tonumber(PlaceHolderText)
            local GetPlaceholderAudioName = game:GetService("MarketplaceService"):GetProductInfo(GID)
            v.PlayerGui.MusicPlayerDisplay.MusicPlayerDisplayFrame.MusicTitle.Text = "Music Title: " .. GetPlaceholderAudioName.Name

        end

        if SoundIdInputFrame ~= nil then

            local GID2 = tonumber(SoundIdInputFrame.Text)
            local GetAudioName = game:GetService("MarketplaceService"):GetProductInfo(GID2)
            v.PlayerGui.MusicPlayerDisplay.MusicPlayerDisplayFrame.MusicTitle.Text = "Music Title: " .. GetAudioName.Name

        end

the output keeps saying Unable to cast Instance to int64 I've tried adding Player to the start and then the ID and that still doesn't work I have no idea why it's doing this and its annoying.

2 answers

Log in to vote
0
Answered by 4 years ago

Never mind I just went with another option since Roblox never actually gives you clear error messages.

Ad
Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

You need to change line 3 from this:

local GID = tonumber(PlaceHolderText)

to this:

local GID = tonumber(PlaceHolderText.Text)

You were trying to call tonumber on the instance rather than the instances Text property.

0
I already tried that it didnt work and I already removed it and went a different way Cryo_Dev 9 — 4y

Answer this question