My code is this: local p = nil
function getToucher(Humanoid) p = Humanoid.Parent.Name print(p) -- debugging end
script.Parent.Touched:Connect(getToucher)
function findPlr(Name) local ser = {} ser = game.Players:GetPlayers() print(ser[1]) --debugging for x = 1,table.getn(ser) do if ser[x] == p then local item = game.ReplicatedFirst.Planks:Clone() -- This is my item's name item.Parent = ser[x].Backpack print("given") --debugging end end end
script.Parent.Touched:Connect(findPlr(p))
And I get these errors: Attempt to connect failed: Passed value is not a function When touched model: attempt to call a nil value
Any help please? Btw I am new to this website so yea.

4 comments
Please put the code in Lua Text
YES PLEASE.
it's the thing that looks like the Lua logo, just re-paste in your code (because indentation is necessary), highlight it, and hit the code block button.
I will help soon. Or have you figured it out?