Создаете в Part скрипт и пишите эти коды
Убивает игрока сразу
Наносит урон игроку
local tool = script.Parent local player = game.Players.LocalPlayer local mouse = player:GetMouse() -- Загружаем анимацию local animation = Instance.new("Animation") animation.AnimationId = "rbxassetid://ВАШ_ID_АНИМАЦИИ" local track -- переменная для AnimationTrack -- когда игрок берёт инструмент tool.Equipped:Connect(function() local char = player.Character local humanoid = char:WaitForChild("Humanoid") track = humanoid:LoadAnimation(animation) mouse.Button1Down:Connect(function() if track then track:Play() end end) end) -- если убрать инструмент — стоп анимации tool.Unequipped:Connect(function() if track then track:Stop() end end)
Создаете в Part скрипт и пишите эти коды
Убивает игрока сразу
Наносит урон игроку
local Players = game:GetService("Players") local TweenService = game:GetService("TweenService") local player = Players.LocalPlayer local frame = script.Parent local line = frame:WaitForChild("Line") -- TextLabel-полоса local text = frame:WaitForChild("Text") -- TextLabel с цифрой local thirstValue = player:WaitForChild("Stats"):WaitForChild("Thirst") local MAX_THIRST = 100 local tweenTime = 0.25 -- Обновление GUI local function updateGui(newValue) local percent = math.clamp(newValue / MAX_THIRST, 0, 1) -- текст text.Text = "Жажда: "..math.floor(percent * 100).."%" -- анимация полосы (Line) local goal = {} goal.Size = UDim2.new(percent, 0, 1, 0) -- ← меняем ширину TweenService:Create( line, TweenInfo.new(tweenTime, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), goal ):Play() -- красная при низкой жажде if percent <= 0.2 then line.BackgroundColor3 = Color3.fromRGB(200, 50, 50) else line.BackgroundColor3 = Color3.fromRGB(0, 170, 255) end end -- при старте updateGui(thirstValue.Value) -- при изменении на сервере thirstValue.Changed:Connect(updateGui)