Got this script here for a throwable shield im working on, im trying to rotate it 90 degrees onto its side but for some reason it doesn’t rotate?
local plr = game.Players.LocalPlayer
local mouse = plr:GetMouse()
local char = plr.Character or plr.CharacterAdded:Wait()
local HumRoot = char:WaitForChild("HumanoidRootPart")
local TweenSerivice = game:GetService("TweenService")
local RunService = game:GetService("RunService")
mouse.Button1Down:Connect(function ()
local viewmodel = game.Workspace.ViewmodelFolder:FindFirstChild("Viewmodel")
local LeftArm = viewmodel:FindFirstChild("Left Arm")
if viewmodel then
local shield = viewmodel:FindFirstChild("Shield")
if shield then
shield.Parent = game.Workspace
LeftArm.LeftWeapon:Destroy()
shield.PrimaryPart.CanCollide = true
shield.PrimaryPart.Anchored = true
shield.PrimaryPart.CFrame = HumRoot.CFrame * CFrame.Angles(math.rad(90),0,0)
local Tween = TweenSerivice:Create(shield.PrimaryPart, TweenInfo.new(0.5, Enum.EasingStyle.Sine), {CFrame = HumRoot.CFrame * CFrame.new(0,0,-50) * CFrame.Angles(math.rad(90),0,0)})
Tween:Play()
Tween.Completed:Connect(function ()
--local Tween2 = TweenSerivice:Create(shield.PrimaryPart, TweenInfo.new(0.5, Enum.EasingStyle.Sine), {CFrame = HumRoot.CFrame})
--Tween2:Play()
local connection
local alphaADD = 0
connection = RunService.RenderStepped:Connect(function ()
shield.PrimaryPart.CFrame = shield.PrimaryPart.CFrame:Lerp(HumRoot.CFrame * CFrame.Angles(math.rad(90),0,0), 0.1 + alphaADD)
alphaADD += 0.01
local magnitude = (HumRoot.Position - shield.PrimaryPart.Position).Magnitude
if connection and magnitude < 0.5 then
print("YES")
connection:Disconnect()
end
end)
end)
end
end
end)