Im not very good using Cframe and Vector3, but i tried, this script "spawn" a model in front of me, and rotate the model to where im looking, but it doesn't work, the script spawn the model, but dont rotate it, what i did wrong?
(Its a LocalScript, in a Tool / The name of the model is test, and i already set the PrimaryPart, that is the "PartePrimaria")
local skateboardId = 2064283039
local Tool = script.Parent;
function insert()
--This call will cause a "wait" until the data comes back
local root = game:GetService("InsertService"):LoadAsset(skateboardId)
local instances = root:GetChildren()
if #instances == 0 then
root:Remove()
return
end
--Continue the insert process
root.Name = "InsertedObject" .. skateboardId
game:GetService("InsertService"):Insert(root)
local t = game.Players.LocalPlayer.Character:FindFirstChild("Torso")
root:MoveTo(t.Position + t.CFrame.lookVector * 8)
root.Test.PartePrimaria:SetPrimaryPartCFrame(CFrame.LookVector)
Tool.Handle.Drop:Play()
end
enabled = true
function onButton1Down(mouse)
if not enabled then
return
end
enabled = false
insert()
wait(.01)
Tool:Remove()
end
function onEquippedLocal(mouse)
if mouse == nil then
print("Mouse not found")
return
end
mouse.Button1Down:connect(function() onButton1Down(mouse) end)
end
Tool.Equipped:connect(onEquippedLocal)
Working script :
local skateboardId = 2064283039
local Tool = script.Parent;
local Player = game:GetService('Players').LocalPlayer
local Character = Player .Character or Player.CharacterAdded:Wait()
local Torso = Character.Torso --<< this is Torso
function insert()
--This call will cause a "wait" until the data comes back
local root = game:GetService("InsertService"):LoadAsset(skateboardId)
local instances = root:GetChildren()
if #instances == 0 then
root:Remove()
return
end
--Continue the insert process
root.Name = script.Parent.Parent.Name
game:GetService("InsertService"):Insert(root)
local t = game.Players.LocalPlayer.Character:FindFirstChild("Torso")
root:MoveTo(t.Position + t.CFrame.lookVector * 8)
root.Test:SetPrimaryPartCFrame(Torso.CFrame + Torso.CFrame.lookVector*10)
Tool.Handle.Drop:Play()
end
enabled = true
function onButton1Down(mouse)
if not enabled then
return
end
enabled = false
insert()
wait(.01)
Tool:Remove()
end
function onEquippedLocal(mouse)
if mouse == nil then
print("Mouse not found")
return
end
mouse.Button1Down:connect(function() onButton1Down(mouse) end)
end
Tool.Equipped:connect(onEquippedLocal)

7 comments
what is "Model" and "Part"?
Model is your Skateboard and Part is the Torso, You'll have to change that, it is just an example
If this worked, I'd really love if you gave me a thumbs up and accept my answer
isn't working :(
i think the error is how i have set the torso
still not working '-'
now it worked, i used "root.Test:SetPrimaryPartCFrame(Torso.CFrame + Torso.CFrame.lookVector*10)"