Problem With My Cooking System

Hello DevFourm! I am working on my own cooking system for the game that I am working on. Everything was going well until I added UI that clones certain foods to the players backpack. I have a grill that has a script to check if the player has a tool equipped.

I can’t explain it well so here’s the grill script:

-- Veriables
local Prox = script.Parent.Parent.Prox2.ProximityPrompt

Prox.Triggered:Connect(function(plr)
	local Char = plr.Character
	
	-- Raw Beef
	if Char:FindFirstChild("Raw Beef") and Char:FindFirstChild("Raw Beef"):IsA("Tool") then
		-- Veriables
		local RawBeef = Char:WaitForChild("Raw Beef")
		local Handle = RawBeef:WaitForChild("Beef")
		local DecoyBeef = script.Parent:WaitForChild("Burger")
		local Sparks = script.Parent.Sparkes.Sparkes
		local Sound = script.Parent.CookingSound
		
		-- Script
		
		-- Start Of Cooking Sequence
		Handle.Transparency = 1
		DecoyBeef.Transparency = 0
		RawBeef.Name = "Cooking..."
		
		-- Effects
		Sparks.Enabled = true
		Sound:Play()
		task.wait(1)
		DecoyBeef.Color = Color3.fromRGB(168, 88, 14)
		DecoyBeef.Material = Enum.Material.Snow
		task.wait(1)
		DecoyBeef.Color = Color3.fromRGB(106, 57, 9)
		------------
		
		task.wait(1)
		
		-- End Of Cooking Sequence
		RawBeef.Name = "Cooked Beef"
		Handle.Color = Color3.fromRGB(106, 57, 9)
		Handle.Material = Enum.Material.Snow -- Make it look like a cooked burger
		Handle.Reflectance = 0
		DecoyBeef.Transparency = 1
		Handle.Transparency = 0
		Sparks.Enabled = false
		Sound:Stop()
		DecoyBeef.Color = Color3.fromRGB(255, 100, 100)
	end
end)

Heres a video of the problem:

The first patty was the test model (witch is the same as the cloned model) The second one I got from the UI was the cloned model. (NO changes to the instance) I’m not sure as there are no errors in the output.

Thank you :slight_smile:

is the 2nd patty from the UI created from the client or server

I think the person above me found the problem: If the “grab patty” button gives the player a patty via LocalScript, the patty will not be in the player’s inventory on the server. You could solve this by using a remote event that fires when a player clicks the button and then a server script gives the patty. Hope this helps!

Yes, the UI is in a local script. I thought it through before checking this post and found that is the problem. Thanks for your help guys :slight_smile:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.