So basically i am trying to make a function where i fire a remote then a Arm appears then curves around the player
local TS = game:GetService("TweenService")
local rarm = game.ServerStorage.arm:Clone()
rarm.Parent = workspace.BarrageEffects
local root = player.Character.HumanoidRootPart
rarm.CFrame = root.CFrame + -root.CFrame.LookVector*2 + root.CFrame.UpVector*2 + -root.CFrame.RightVector*4
rarm.Orientation = Vector3.new(22.52, -135.9, -69.64)
rarm:ClearAllChildren()
rarm.Anchored = true
function lerp(a, b, c)
return a + (b - a) * c
end
function quadBezier(t, p0, p1, p2)
local l1 = lerp(p0, p1, t)
local l2 = lerp(p1, p2, t)
local quad = lerp(l1, l2, t)
return quad
end
local p0 = root.Position + -root.CFrame.LookVector*2 + root.CFrame.UpVector*2 + root.CFrame.RightVector*4
local p1 = root.Position + root.CFrame.LookVector*4 + root.CFrame.RightVector*7
local p2 = root.Position + root.CFrame.LookVector*10 + -root.CFrame.UpVector*2 + root.CFrame.RightVector*.3
spawn(function()
for t = 0,1,.08 do
local curve = quadBezier(t,p0,p1,p2)
rarm.CFrame = CFrame.new(curve)
game:GetService("RunService").Heartbeat:Wait()
end;
end)
game.Debris:AddItem(rarm,1)
this is what i have and it works but idk how to make it rotate as well please help me
