Part of a modulescript, so sometimes runs locally.
local function GetAdornee()
repeat
local success , err = pcall(function()
local asset
if game:GetService("RunService"):IsClient() == true then
asset = game.ReplicatedStorage.GetCreatureModel:InvokeServer(AdorneeId)
else
asset = game:GetService("InsertService"):LoadAsset(AdorneeId):FindFirstChildWhichIsA("Model")
end
assert(asset)
return asset
end)
if err then warn(err) end
wait(0.5)
until success
end
remote function:
game.ReplicatedStorage.GetCreatureModel.OnServerInvoke = function (Player , AdorneeId)
local asset = game:GetService("InsertService"):LoadAsset(AdorneeId):FindFirstChildWhichIsA("Model")
asset.Parent = Player.PlayerGui.BattleScreen.Frame.ViewportFrame.WorldModel
wait()
return asset
end
The error returned is the model’s name for some reason