I am aware of SetPrimaryPartCFrame, but I was wondering how to use this to rotate a part 90* Anti-clockwise, and 90* clockwise when you click a button,

What I have so far.

local open = script.Parent.Active.Value
script.Parent.MouseButton1Click:connect(function()		
local movements=90 --How far it needs to go
local speed=0.2 --How fast I would like it (0.2 studs every 0.01 seconds)
	if open == false then
		for i=1,movements do
			wait(0.01)
			script.Parent.PLT:SetPrimaryPartCFrame(--[===[I draw a blank here]===]) -- to go 90* Anti-clockwise
		end
        elseif open == true then
		for i=1,-movements do
			wait(0.01)
			script.Parent.PLT:SetPrimaryPartCFrame(--[===[I draw a blank here]===]) -- to go 90* clockwise
		end
end)

I have attempted to use the wiki but that didn't help either.

Thank you to whoever helps me.


TheHospitalDev

1 comment