ok so this script is in a npc so when they eat it they get the XP but it eats everything listed as a "Tool" and i want it to eat a specific tool not all the tools....EX: it eats swords and guns and all i want it to eat is the Fruit.
local thename = game.Players:findFirstChild(script.Parent.Owner.Value).PlayerGui.GuiProject1 d = script.Parent:Clone() debounce = false function t(h) if debounce == false then debounce = true if h.Name == "Handle" then if h.Parent.className == "Tool" then h.Parent:Remove() thename.AnimalHunger.Value = 0 thename.AnimalXP.Value = thename.AnimalXP.Value + 3 script.Parent.NOM:Play() end end debounce = false end end script.Parent.Torso.Touched:connect(t)
local thename = game.Players:findFirstChild(script.Parent.Owner.Value).PlayerGui.GuiProject1 d = script.Parent:Clone() debounce = false function t(h) if debounce == false then debounce = true if h.Name == "Handle" then if h.Parent:IsA('Tool') and h.Parent.Name == "TOOLyouWantRemove" then -- change name here to name of tool you want removed. h.Parent:Remove() thename.AnimalHunger.Value = 0 thename.AnimalXP.Value = thename.AnimalXP.Value + 3 script.Parent.NOM:Play() end end debounce = false end end script.Parent.Torso.Touched:connect(t)