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

How would I get this part to spin around the player?

Asked by
yoshi8080 445 Moderation Voter
8 years ago

I can't seem to make the part's position to move like 5 studs away from the players torso and move around it.

game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(char)
local part = Instance.new("Part",char:WaitForChild("Torso"))
    while wait() do
local objectSpace = CFrame.Angles(0, 0, -5)
    objectSpace = part.Position
local worldSpace = part.CFrame:toWorldSpace(objectSpace)
    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)
part:Destroy()
sparkles:Destroy()
end
end)
end)

When I test it this shows Players.Player1.Backpack.LocalScript:7: bad argument #1 to 'toWorldSpace' (CFrame expected, got Vector3)

Answer this question