Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How do I CFrame the pet so it won't glitch from being removed?

Asked by
yoshi8080 445 Moderation Voter
9 years ago

I made the pet follow the player, it it glitches since I remove it. Any other way to fix this?

local plr = game.Players.LocalPlayer
local torso = plr.Character:WaitForChild("Torso")

while wait() do
local objectSpace = CFrame.Angles(0, 0, -5)
objectSpace = CFrame.new(-5, 0, 0)

local worldSpace = torso.CFrame:toWorldSpace(objectSpace)

local part = Instance.new("Part",workspace)
part.Anchored = true
part.CFrame = worldSpace
part.CanCollide = false
part.Size = Vector3.new(2,2,2)
local sparkles = Instance.new("Sparkles",part)
sparkles.SparkleColor = Color3.new(144,25,255)
local mesh = Instance.new("SpecialMesh",part)
mesh.TextureId = "http://www.roblox.com/asset/?id=83992632"
mesh.MeshId = "http://www.roblox.com/asset/?id=84003494"
mesh.Scale = Vector3.new(1,1,1)
wait(.1)
part:Destroy()
end

Any other way to not glitch the part?

1 answer

Log in to vote
0
Answered by
xuefei123 214 Moderation Voter
9 years ago

Make the pet's parent not the character, but workspace, or the player model in workspace

0
The pet is already placed in the player's model which is what the script says? yoshi8080 445 — 9y
Ad

Answer this question