local Players = game:GetService("Players") local RunService = game:GetService("RunService") local player = Players.LocalPlayer local tool = script.Parent local character = player.Character local head = nil local hand = nil -- دالة لتحديث الشخصية والجزء المطلوب local function setupCharacter() character = player.Character or player.CharacterAdded:Wait() head = character:WaitForChild("Head") hand = character:FindFirstChild("RightHand") or character:FindFirstChild("Right Arm") end -- إعداد الشخصية أول مرة setupCharacter() -- تحديث الشخصية لو تغيرت (مثلاً عند الموت والولادة مجدداً) player.CharacterAdded:Connect(function(char) character = char setupCharacter() end) -- إنشاء السيجارة local cigarette = Instance.new("Part") cigarette.Name = "Cigarette" cigarette.Size = Vector3.new(0.1, 0.1, 0.5) cigarette.BrickColor = BrickColor.new("Institutional white") cigarette.Material = Enum.Material.SmoothPlastic cigarette.Anchored = false cigarette.CanCollide = false cigarette.Transparency = 1 -- تبدأ مخفية cigarette.Parent = character -- Weld افتراضي لليد local function weldToHand() if cigarette:FindFirstChildOfClass("Weld") then cigarette:FindFirstChildOfClass("Weld"):Destroy() end local weld = Instance.new("Weld") weld.Part0 = hand weld.Part1 = cigarette weld.C0 = CFrame.new(0, -0.5, -0.2) * CFrame.Angles(math.rad(90), 0, 0) weld.Parent = cigarette end weldToHand() -- Attachment في الفم local mouthAttachment = Instance.new("Attachment") mouthAttachment.Name = "MouthAttachment" mouthAttachment.Position = Vector3.new(0.03, -0.15, -0.43) mouthAttachment.Parent = head -- إضافة الدخان local smoke = Instance.new("ParticleEmitter") smoke.Name = "MouthSmoke" smoke.Texture = "rbxasset://textures/particles/smoke_main.dds" smoke.Rate = 6 smoke.Lifetime = NumberRange.new(1, 1.5) smoke.Speed = NumberRange.new(1, 2) smoke.Size = NumberSequence.new({ NumberSequenceKeypoint.new(0, 0.35), NumberSequenceKeypoint.new(0.5, 0.25), NumberSequenceKeypoint.new(1, 0) }) smoke.Transparency = NumberSequence.new({ NumberSequenceKeypoint.new(0, 0.1), NumberSequenceKeypoint.new(1, 1) }) smoke.EmissionDirection = Enum.NormalId.Front smoke.Enabled = false smoke.Parent = mouthAttachment -- الأصوات local lighterSound = Instance.new("Sound", head) lighterSound.SoundId = "rbxassetid://9118823108" lighterSound.Volume = 1 local extinguishSound = Instance.new("Sound", head) extinguishSound.SoundId = "rbxassetid://138087017" extinguishSound.Volume = 1 -- تحريك الفم local animConnection = nil local function startMouthAnimation() local timer = 0 animConnection = RunService.Heartbeat:Connect(function(dt) timer += dt local offset = math.sin(timer * 6) * 0.004 mouthAttachment.Position = Vector3.new(0.03, -0.15 + offset, -0.43) end) end local function stopMouthAnimation() if animConnection then animConnection:Disconnect() animConnection = nil end mouthAttachment.Position = Vector3.new(0.03, -0.15, -0.43) end -- الفم ↔ اليد local function moveToMouth() if cigarette:FindFirstChildOfClass("Weld") then cigarette:FindFirstChildOfClass("Weld"):Destroy() end local weld = Instance.new("Weld") weld.Part0 = head weld.Part1 = cigarette weld.C0 = CFrame.new(0.03, -0.15, -0.43) * CFrame.Angles(0, math.rad(90), 0) weld.Parent = cigarette end local function moveToHand() if cigarette:FindFirstChildOfClass("Weld") then