I am attempting to make spinning swords around my Roblox character based on a remote function. Though it only seems to spin, and not follow my character. Here is the code: ~~~~~~~~~~~~~~~~~ local tool = script.Parent local eFunc = tool:WaitForChild('EFunction') local debounce = false local repStor = game:GetService('ReplicatedStorage') local TweenService = game:GetService('TweenService')
eFunc.OnServerInvoke = function(player, root) if player.Character:FindFirstChild('DefenderSword') and not debounce then debounce = true local swords = repStor.SwordCircle:Clone() swords.Parent = game.Workspace swords.Position = root.Position
local goal = {
CFrame = swords.CFrame * CFrame.Angles(0, math.rad(180), 0)
}
local tweenInfo = TweenInfo.new(0.5, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 6, false, 0)
local tween = TweenService:Create(swords, tweenInfo, goal)
tween:Play()
local attach1 = root:WaitForChild('RootRigAttachment')
local attach0 = Instance.new('Attachment')
attach0.Parent = swords
local alignp = Instance.new('AlignPosition')
alignp.Parent = swords
alignp.Attachment0 = attach0
alignp.Attachment1 = attach1
alignp.MaxForce = 25000
local aligno = Instance.new('AlignOrientation')
aligno.Parent = swords
aligno.Attachment0 = attach0
aligno.Attachment1 = attach1
aligno.MaxTorque = 25000
wait(3)
swords:Destroy()
debounce = false
end
end
