This is a script that inserts a skateboard model into Workspace when a RemoteEvent is fired from the client. However, the model is missing 4 Rotate instances when it is inserted.
local skateboardRequest = Instance.new("RemoteEvent")
local insService = game:GetService("InsertService")
skateboardRequest.Parent = game.Workspace
skateboardRequest.Name = "requestSkateboard"
local function onRequestEvent(player, id)
local skateboard = insService:LoadAsset(id)
insService:Insert(skateboard)
local Torso = player.Character:FindFirstChild("Torso")
if skateboard ~= nil then
local instances = skateboard:GetChildren()
skateboard.Name = player.UserId.."skateboard"
if #instances == 0 then
skateboard:Remove()
return
end
skateboard:MoveTo(Torso.Position + Torso.CFrame.lookVector * 8)
print("inserted and moved skateboard to character")
end
end
skateboardRequest.OnServerEvent:Connect(onRequestEvent)
When I insert the model from the toolbox, it includes the Rotate instances, shown here:
But when I insert the model using InsertService, all of the Rotate’s are missing. Is there anything I can do to fix this?