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.
Line 3. I don't know what you are trying to play, but given that script.Parent
is a part, and the error is that workspace
does not have function Play
. script.Parent.Parent
must be the workspace the script is referencing. Try removing the line or commenting it.
You have to define what the tween does, look at the tween docs, you dont play the object you are trying to move, you have to define what the tween does and you play that. Look at the tweenservice docs for help, or watch alvinblox videos.