local Plow = script.Parent.Parent.plow script.Parent.ChildAdded:connect(function(child) if child:IsA("Weld") then player = game.Players:GetPlayerFromCharacter(child.Part1.Parent) print ("Got Driver") print (player) wait() else print ("ERROR") end end) Plow.Touched:connect(function(hit) if hit.Name == "Seed" and hit.Transparency == 0 then print("Conencted") player.leaderstats.Seeds.Value = player.leaderstats.Seeds.Value + 1 local oof = player.Name hit.Parent.Parent = game.Lighting(oof) else print("Not Seed") end if hit.Name == "Wheat" then print("Is Wheat") end end)
Error - RejectedAffection is not a valid member of Lighting
Basically I have these Models of wheat plants that include their lifespan so several blocks and this is a script from my Plow which is supposed to move that whole Model (which there are several of) to a folder with your in game name that is located in Lighting
Try using :FindFirstChild()
local Plow = script.Parent.Parent.plow script.Parent.ChildAdded:connect(function(child) if child:IsA("Weld") then player = game.Players:GetPlayerFromCharacter(child.Part1.Parent) print ("Got Driver") print (player) wait() else print ("ERROR") end end) Plow.Touched:connect(function(hit) if hit.Name == "Seed" and hit.Transparency == 0 then print("Conencted") player.leaderstats.Seeds.Value = player.leaderstats.Seeds.Value + 1 local oof = player.Name hit.Parent.Parent = game.Lighting:FindFirstChild(oof) --//Right here else print("Not Seed") end if hit.Name == "Wheat" then print("Is Wheat") end end)