Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- ประกาศการใช้ TweenService
- local TweenService = game:GetService("TweenService")
- -- หา Part ที่เราต้องการจะ Tween
- local part = script.Parent
- -- กำหนดค่าเป้าหมาย (goal) ที่ต้องการให้ Part เปลี่ยนแปลง
- local goal = {}
- goal.Position = Vector3.new(131.059, 4.775, 15.742)
- -- กำหนดการตั้งค่าของ Tween
- local tweenInfo = TweenInfo.new(
- 8, -- เวลาที่ใช้ในการ Tween (วินาที)
- Enum.EasingStyle.Sine, -- รูปแบบการเคลื่อนไหว (EasingStyle)
- Enum.EasingDirection.InOut, -- ทิศทางการเคลื่อนไหว (EasingDirection)
- -1, -- จำนวนครั้งที่ต้องการให้ Tween วนซ้ำ (0 = ไม่วนซ้ำ)
- true, -- กำหนดว่า Tween ควรย้อนกลับหรือไม่ (reverse)
- 0 -- เวลาหน่วงก่อน Tween เริ่ม (วินาที)
- )
- -- สร้าง Tween
- local tween = TweenService:Create(part, tweenInfo, goal)
- -- เริ่มการ Tween
- tween:Play()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement