Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why do I get this error in my "tool" giver script? - PLEASE HELP

Asked by 8 years ago

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.

0
Are you sure the tool is in lighting and has that exact name? RafDev 109 — 8y
0
On line 3, you wrote "Lightning" instead of "Lighting". Change that and tell me what happens. Uglypoe 557 — 8y

Answer this question