Hello, I've been trying to make a gate that opens vertically. Yet it doesn't work at all.
script.Parent.PromptButtonHoldEnded:Connect(function(plr) local original = script.Parent.Parent local up = script.Parent.Parent.Parent.Arrival if plr.Team ~= game.Teams.CD then local goalData = {CFrame = up.CFrame} local tween = game.TweenService:Create(script.Parent.Parent,TweenInfo.new(4),goalData) tween:Play() goalData = {CFrame = original.CFrame} local tween = game.TweenService:Create(script.Parent.Parent,TweenInfo.new(4),goalData) tween:Play() print("hi") end end)
Tween's have an event called completed()
We can use this to yield:
Tween.Completed:Wait()
This will wait until the tween has finished its animation