local function OnClick(player)
local TweenService = game:GetService("TweenService")
script.Parent.Parent:Play()
local part = script.Parent
part.Position = Vector3.new(-8.95, 6.7, 2.35)
part.Color = Color3.new(1, 0, 0)
part.Anchored = true
part.Parent = game.Workspace
local goal = {}
local tweenInfo = TweenInfo.new(5)
local tween = TweenService:Create(part, tweenInfo, goal)
local PeePee = part.Position(-0.65, 6.7, 2.35)
if PeePee == true then
goal.Position = Vector3.new(-8.95, 6.7, 2.35)
end
if PeePee == false then
goal.Position = Vector3.new(-0.65, 6.7, 2.35)
goal.Color = Color3.new(0, 1, 0)
end
tween:Play()
end
script.Parent.ClickDetector.MouseClick:connect(OnClick)
**Okay so my script is the one above ^
and basically... Im trying to make a door animation, and if its already at position -0.65 6.7 2.35 then it'll tween back to the previous position. but it keep saying :play is not a valid member of workspace, please help.

5 comments
First, use the code block thingy please. It's harder to read without it.
Also, you don't need the "do" in if statements. They're for for loops.
Ok I did it
What is script.Parent.Parent and why are you trying to play it
script.Parent.Parent is likely the Workspace service that you're attempting to call Play() from. Play() is a function custom to Tweens, AnimationTrack and Sound instances. You can create a tween using the TweenService and play that tween, if that is what you're trying to do.