Hello! my name is bullet, and I have recently run into an issue, so: let me explain.
The tweenservice just isn’t working, so here are the conditions.
-
The " Hinge " part is anchored, but the Part the hinges are connected to are not.
-
The script has no errors, and the rest of it continues to run and works properly.
that is all the conditions, and here is the script:
-- by: bullettrain5
-- Variables
local Sound = script.Sound
local TweenService = game:GetService("TweenService")
local Door = script.Parent.Parent.Parent.Parent
local Hinge = Door.PrimaryPart
local DoorSwingInfo = TweenInfo.new(1.5, Enum.EasingStyle.Linear)
local PropertyToTween = {Orientation = Vector3.new(0, 90, 0)}
local DoorSwingTween = TweenService:Create(Hinge,DoorSwingInfo, PropertyToTween)
-- Main Code
local function OpenDoor()
DoorSwingTween:Play()
Sound:Play()
script.Parent.MaxActivationDistance = 0
end
-- Function Enablers
script.Parent.MouseClick:Connect(OpenDoor)
Thanks for reading, and please help!