Help! "Unable to cast string to int64

Hello, My Script has this issue and I am not sure as not many other posts help?

local ImageLabel = script.Parent.UserPic

local Players = game:GetService("Players")

local Id = script.Parent.Parent.ANPR.Value.Info.OwnerID.Value

local ThumbType = Enum.ThumbnailType.HeadShot

local ThumbSize = Enum.ThumbnailSize.Size150x150

local plrAvatar, isReady = Players:GetUserThumbnailAsync(Id, ThumbType, ThumbSize)


while true do

wait()

script.Parent.FrontPlate.Text = script.Parent.Parent.ANPR.Value.Info.Reg.Value

script.Parent.RearPlate.Text = script.Parent.Parent.ANPR.Value.Info.Reg.Value

script.Parent.Username.Text = script.Parent.Parent.ANPR.Value.Info.Owner.Value

script.Parent.Markers.Text = script.Parent.Parent.ANPR.Value.Info.Markers.Value

script.Parent.UserPic.Image = plrAvatar

end

Could show me the line thats erroring?

Line 8:
local plrAvatar, isReady = Players:GetUserThumbnailAsync(Id, ThumbType, ThumbSize)

I would imagine that Id isn’t a valid number. Print Id when it errors and see what it is.

You need to change the ID string (if it is a StringValue) to a number using tonumber()
change to:

local plrAvatar, isReady = Players:GetUserThumbnailAsync(tonumber(Id), ThumbType, ThumbSize)

another issue:

"Argument 1 missing or nil ", same line

local plrAvatar, isReady = Players:GetUserThumbnailAsync(tonumber(Id), ThumbType, ThumbSize)

can you print Id and tonumber(Id) and send it here?

print(id) ?? Is that what you mean

Once again, the Id isn’t a valid number (im assuming)

put Warn(Id) below the line that’s erroring

1 Like

yes, do print(Id) and print(tonumber(Id) and send the output here

Print(Id) “nil”

Print(tonumber(Id) " " blank

script.Parent.Parent.ANPR.Value.Info.OwnerID.Value does not exist
Can you send a screen shot of your explorer?

Ahh , It Doesn’t Have a Value Il sort it now

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.