Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Getting this morph to work?

Ok so I have this script that basically makes this huge model appear behind you but I keep running into a couple problems. Firstly the model appears where your torso was but you get launched 200-300 studs in a random position, also you occasionaly get pushed under the map and once the Welds get delted you fall to your death, How can I fix this?

Side Note:I know this script is very sloppy, I was in that try anything to get this to work stage

wait(2)
local bin = script.Parent
local Player = game.Players.LocalPlayer
local mouse = Player:GetMouse()
local c = Player.Character

enabled = true


function onButton1Down(mouse)
	if not enabled then return end
	local player = game.Players.LocalPlayer
	if player == true then return end
	print("trigger")
	-- find the best cf

enabled = false
game:GetService("Chat"):Chat(c.Head, "Saiken!!!")
C=c.Torso.CFrame
wait(0.001)
local B1 = script.Parent.Saiken:Clone()
local B2 = B1:GetChildren()
B1.Parent = game.Workspace




B1.Name = ("6 Tail")
B1.PrimaryPart = B1.Chest
B1:SetPrimaryPartCFrame(C*CFrame.new(0, 0, 30))
for i = 1, #B2 do
game.Players.LocalPlayer.Character.HumanoidRootPart.Anchored = true   
W1 = Instance.new("Weld")
   W1.Parent = B2[i]
   W1.Part0 = game.Players.LocalPlayer.Character.HumanoidRootPart
   W1.Part1 = B2[i]
   W1.C0 = C*B2[i].CFrame

game.Players.LocalPlayer.Character.HumanoidRootPart.Anchored = false
game:GetService("Debris"):AddItem(W1, 19.9)
end

wait(1)

game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 100
game:GetService("Debris"):AddItem(B1, 20)
wait(25)
game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 16

enabled = true
end

function onSelected(mouse)
	print("select")
	mouse.Icon = "rbxasset://textures\\GunCursor.png"
	mouse.Button1Down:connect(function() onButton1Down(mouse) end)
end

bin.Selected:connect(onSelected)

2 answers

I'm on my mobile so I cant test this, but all you need to do is make an offset for the model so it spawns behind the character.

Just add this to the model's position before spawning it in: C:vectorToWorldSpace(Vector3.new(0,0,20))

This discussion is preserved as it was. New answers, comments, and votes are closed.