Ouput / Error:

17:55:56.748 - Lighting is not a valid member of DataModel

17:55:56.748 - Script 'Workspace.Strawberry Cake.FoodMaster', Line 3

17:55:56.748 - Stack End

local sp = script.Parent
local detector = sp:WaitForChild("ClickDetector")
local cookie = game.Lightning.Foods["Strawberry Cake"] --Line 3

function caik(plr)

local clone = cookie:Clone()
	clone.Parent = plr:WaitForChild("Backpack")

end

detector.MouseClick:connect(caik)

Thanks, Replicat3dData.

2 comments

0

Are you sure the tool is in lighting and has that exact name?

0

On line 3, you wrote "Lightning" instead of "Lighting". Change that and tell me what happens.