Hi there, I’m currently working on a Jojo’s Bizarre Adventure game. I am also an amateur at scripting. I had a script that worked fine for summoning a “stand”, but I hated that the stand just appeared next to you, instead of going to a certain spot, starting from your character.
I’ve tried this, which I saw from another topic, however it just started flinging me around the map.
Mystand:WaitForChild("HumanoidRootPart").CFrame = HumanoidRP.CFrame * CFrame.new(0, 0, 0)
for i = 0,1,0.1 do
wait()
Mystand.HumanoidRootPart.CFrame = Mystand.HumanoidRootPart.CFrame:Lerp(Mystand.HumanoidRootPart.CFrame * CFrame.new(2, 0, 3), i)
end
local weld = Instance.new("ManualWeld")
weld.Name = "Stand Weld"
weld.Part0 = Mystand:WaitForChild("HumanoidRootPart")
weld.Part1 = HumanoidRP
weld.C0 = Mystand:WaitForChild("HumanoidRootPart").CFrame:inverse() * HumanoidRP.CFrame
weld.Parent = weld.Part0
The problem is, if I were to edit the CFrame before I weld it to the user’s HumanoidRootPart, it would fall, then weld, leaving it stuck underground. If I edit it after welding, it moves both me and the stand infinitely.
Is there a way for me to make the stand come out, then weld? (The stand is also unanchored, cannot collide, and is massless.)
local humrootpart = chr.HumanoidRootPart
local weld = Instance.new("ManualWeld", humrootpart)
weld.Part0 = humrootpart
weld.Part1 = Mystand.HumanoidRootPart
local cframeoffset = CFrame.new(0, 0 , 0) --edit these to change the position
local lerpvalue = Mystand.HumanoidRootPart.CFrame:inverse() * humrootpart.CFrame * cframeoffset
local originalc0 = weld.C0
for i = 0, 1, 0.1 do
wait()
weld.C0 = originalc0:lerp(lerpvalue, i)
end