I am trying to make a gui that shows the selected sword which is supposed to rotate, however it won’t, there is no errors regard the script, I have tried several different methods but not a single one works, here are some screenshot and the current script, I have made the handle visible to show the rotation:
local TweenService = game:GetService("TweenService")
local viewportFrame = script.Parent
local part = nil
script.Parent.Parent.Selected.Changed:Connect(function()
if part ~= nil then
part:Destroy()
end
part = script.Parent.Parent.Selected.Value:Clone()
part:SetPrimaryPartCFrame(CFrame.new(Vector3.new(0,16,16),Vector3.new(-180, -90, 135)))
--part.Position = Vector3.new(0, 18, 18)
--part.Orientation = Vector3.new(-24, 127, 38)
part.Parent = viewportFrame
local viewportCamera = Instance.new("Camera")
viewportFrame.CurrentCamera = viewportCamera
local tweenInfo = TweenInfo.new(5, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut)
local tween = TweenService:Create(part.PrimaryPart, tweenInfo, {Orientation = Vector3.new(0,360,0)})
while true do
tween:Play()
tween.Completed:Wait()
end
end)
