So This is an eating script I need it after you eat the item goes away I tried it did not work fell free! to redo the script I guess but I would like if you would teach me how to do this please.
local Tool = script.Parent;
enabled = true
function onActivated()
if not enabled then
return
end
enabled = false
Tool.GripForward = Vector3.new(-0.976,0,-0.217)
Tool.GripPos = Vector3.new(.95,-0.76,1.4)
Tool.GripRight = Vector3.new(0.217,0, 0.976)
Tool.GripUp = Vector3.new(0,1,0)
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
h.Health = h.MaxHealth
end
end
Tool.GripForward = Vector3.new(-0.976,0,-0.217)
Tool.GripPos = Vector3.new(0.3,0,0)
Tool.GripRight = Vector3.new(0.217,0,-0.976)
Tool.GripUp = Vector3.new(0,1,0)
local part = script.Parent.Cookie -- The variable
function
wait (0.01)
part:Destroy()
end
enabled = true
end
script.Parent.Activated:connect(onActivated)

1 comment
You don't need another function to wait and destroy the cookie.