Tween rotation playing before i tell it to play

i want to rotate tween a part, i have a wait(10) set up, but when i playtest it plays the tween without waiting 10 seconds.

this is my script:

local part = script.Parent
local ts = game:GetService("TweenService")
local ti = TweenInfo.new(10, Enum.EasingStyle.Linear, Enum.EasingDirection.Out) 
local ti2 = TweenInfo.new(-1, Enum.EasingStyle.Cubic, Enum.EasingDirection.Out)
local propertyToTween = {Orientation = Vector3.new(0, 42.4, 0), Position = Vector3.new(195.983, 5.106, 87.994)}
local propertyToTween2 = {Orientation = Vector3.new(0, -90, 0), Position = Vector3.new(198.374, 5.106, 88.817)}

local tweenOpen = ts:Create(part, ti, propertyToTween)
local tweenClose = ts:Create(part, ti2, propertyToTween2)

local function open()
	tweenOpen:Play()
end

local function close()
	tweenClose:Play()
end

wait(4)
open()
wait(5)
close()

i dont see what i’m doing wrong.

I see no problems with the script itself, BUT, I assume that the tweening is playing from a server script and looks to be playing before told, but the player loads in at least a few seconds after the server does. Also, wait() is deprecated and throttles, use task.wait() instead.

you’re right, it was from a server sided script. Also thanks for the task.wait() part.