Going back to original position. (Model)

  1. What do you want to achieve? If player press 2nd time it will go back to original position

  2. What is the issue? I dont know how to make that.

  3. What solutions have you tried so far? Yes. But nothing.

local Button = script.Parent
local Model = script.Parent.Parent.Parent.Party
rotation = CFrame.Angles(0, math.rad(90), 0)
modelCFrame = Model:GetPivot()

Button.MouseClick:Connect(function(plr)
	if plr:GetRankInGroup(GROUPID) >= GROUPRANK then
	Model:PivotTo(modelCFrame * rotation)
		Model:MoveTo(Vector3.new(-81.226, 5.85, 333.25))
		end
end)

Using MoveTo after you use PivotTo doesn’t make sense.

What should I do…
I made this script for the door.

image

If plr pressed this that door will open.

Maybe you meant to do something like this?

local Button = script.Parent
local Model = script.Parent.Parent.Parent.Party
local doorc = Model:GetPivot()

local open = false
Button.MouseClick:Connect(function(plr)
	if plr:GetRankInGroup(GROUPID) >= GROUPRANK then
		open = not open
		if open then
			Model:PivotTo(doorc * rotation)
		else
			Model:PivotTo(doorc)
		end
	end
end)
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.