Hello everyone, i had this script for an old game. It’s parented to a textbutton and an inputbox where the player could insert and ID and get that item, but now that i need this script again, my output reports “Unable to cast string to int64”, not really sure what happened but it worked fine a while ago.
local Button = script.Parent
local Player = game.Players.LocalPlayer
function insert()
local ID = script.Parent.Parent.InputBox.Text
local Object = game:GetService("InsertService"):LoadAsset(ID)
Object.Parent = game.Workspace
Object:MoveTo(Player.Character.Torso.Position)
end
script.Parent.MouseButton1Down:connect(insert)
The text is a string, you’ll need to use tonumber() on it.
And yes, you also need to set up a remoteevent as the server deals with this kind of stuff (:LoadAsset().)