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