local InsertService = game:GetService("InsertService")
local Send = game.ReplicatedStorage.Send
Send.OnServerEvent:Connect(function(id)
local Assetid = id
local Model = InsertService:LoadAsset(Assetid)
Model.Parent = game.Workspace
Model.Name = "InsertedModel:" .. Assetid
Model:MakeJoints()
return Model:GetChildren()[1]
end)
✓ ANSWER ACCEPTED
Unable to cast instance to int64?
1 answer
✓ Accepted answer
your code is basically right but whenever you get a server event fired the first parameter is always the player no matter what.
local InsertService = game:GetService("InsertService")
local Send = game.ReplicatedStorage.Send
Send.OnServerEvent:Connect(function(player, id)-- player is the first parameter
local Assetid = id
local Model = InsertService:LoadAsset(Assetid)
Model.Parent = game.Workspace
Model.Name = "InsertedModel:" .. Assetid
Model:MakeJoints()
return Model:GetChildren()[1]
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

5 comments
What is the error line?
We need more info, Like what script called the Event what are you trying to achieve?
My understanding is that LoadAsset requires an AssetId but you gave it an instance. But i don't know what the instance is
Unable to cast instance to int64
nicholast013