This is probably the dumbest way to break it down:
-
Upon touch of the grill with the “Burger Buns w/Meat” tool equipped, the tool will be destroyed (Or just parented to nil) and a prop will replace the Tool so that it looks like it’s cooking
-
Wait for a couple of seconds, then give the cooked burger the Player
The way how we could do this, is by using a Touched
event inside the Grill Part, which pretty much detects when a part gets touched by another part physics-wise
Say we insert a script for our tool we want to cook:
local TouchOnce = false
local Tool = script.Parent
local Handle = Tool.Handle
Handle.Touched:Connect(function(Hit)
end)
The TouchOnce
variable will only fire once using a conditional check, the Handle
is what we want to use the Touched
event on (Or the grill, doesn’t really matter) & we’re setting our Event
Next, we’ll add this inside our event:
Handle.Touched:Connect(function(Hit)
local Character = Tool.Parent
local Player = game.Players:GetPlayerFromCharacter(Character)
if Player and Hit.Name == "Grill" and TouchOnce == false then
TouchOnce = true
Tool = nil
wait(5)
local CookedBurger = game.ServerStorage.CookedBurger:Clone()
CookedBurger.Parent = Player.Backpack
Tool:Destroy()
end
end)
Now you may think: “THIS IS A LOT OF STUFF” and you’re kinda right but let’s break this down here 
local Character = Tool.Parent
local Player = game.Players:GetPlayerFromCharacter(Character)
These lines are basically just getting our Player that touched the Grill with the burger, so we can save it later on in their backpack
if Player and Hit.Name == "Grill" and TouchOnce == false then
Next, we’re implementing 3 conditional checks: 1 if the Player is valid, 1 if the Part that we hit is a “Grill” part, and that our TouchOnce
is set to false
so we can set it to true
from preventing any overlapping events fired
TouchOnce = true
Tool = nil
local PropTool = game.ServerStorage.GrillBurger:Clone()
PropTool.Parent = workspace.Grill.Position + Vector3.new(0, 5, 0)
wait(5)
PropTool:Destroy()
local CookedBurger = game.ServerStorage.CookedBurger:Clone()
CookedBurger.Parent = Player.Backpack
Tool:Destroy()
We’re setting our TouchOnce
to true, now we’re actually setting our Tool
variable to nil
cause we want to still save the script that’s inside the Tool
Next we’re creating a prop burger for the grill to cook, then setting its position correcrtly
Then after 5 seconds, we can give the Cooked Burger to the Player and destroy our old tool cause we don’t need it anymore!