Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Tool = script.Parent;
- local player = game.Players.LocalPlayer
- local Character = player.Character or player.CharacterAdded:Wait()
- enabled = true
- function onActivated()
- if not enabled then
- return
- end
- Tool.Handle.Eating:Play()
- wait(.8)
- local h = Tool.Parent:FindFirstChild("Humanoid")
- if (h ~= nil) then
- if (h.MaxHealth > h.Health + 1.6) then
- h.Health = h.Health + 1.6
- else
- if Tool:WaitForChild("stacks") and Tool.stacks.Value > 1 then
- Tool.stacks.Value -= 1
- local eatAnimation = script.EatAnim
- Character.Humanoid:LoadAnimation(eatAnimation):Play()
- Character.Humanoid:UnequipTools()
- else
- Tool:Destroy()
- end
- end
- end
- enabled = true
- end
- Tool:WaitForChild("stacks").Changed:Connect(function(value)
- Tool.ToolTip = "X "..value
- end)
- Tool.ToolTip = "X "..Tool.stacks.Value
- script.Parent.Activated:connect(onActivated)
Advertisement
Add Comment
Please, Sign In to add comment