Hi!
I want to made a TweenAnimation that smoothly changing a Position but this script doesn’t work
The script:
local function Open()
local TweenService = game:GetService("TweenService")
local part = script.Parent
local Info = TweenInfo.new(
0.8, -- Length
Enum.EasingStyle.Linear, -- Easing Style
Enum.EasingDirection.Out, -- Easing Direction
0, -- Times repeated
false, -- Reverse
0 -- Delay
)
local Goals =
{
Positon = UDim2.new(24.989, 6.899, -40.33);
}
local tween = TweenService:Create(part,Info,Goals)
tween:Play()
end
local function Close()
local TweenService = game:GetService("TweenService")
local part = script.Parent
local Info = TweenInfo.new(
0.8, -- Length
Enum.EasingStyle.Linear, -- Easing Style
Enum.EasingDirection.Out, -- Easing Direction
0, -- Times repeated
false, -- Reverse
0 -- Delay
)
local Goals =
{
Position = UDim2.new(36.679, 6.899, -40.33);
}
local tween = TweenService:Create(part,Info,Goals)
tween:Play()
end
local isOpened = false
local Proximity = script.Parent.ProximityPrompt
if isOpened == false then
Proximity.ActionText = "Open door"
Proximity.Triggered:Connect(function(player)
Open()
end)
elseif isOpened == true then
Proximity.ActionText = "Close door"
Proximity.Triggered:Connect(function(player)
Close()
end)
end
Error: