Can someone tell me why this seat script give's the error attempt to index a nil value in output, I don't explain the script that much since it's pretty self-explanatory, but basically I am trying to make it print the username of whatever user is sitting.
Code:
script.Parent.ChildAdded:connect(function(child)
if child:IsA("Weld") then
local player = game.Players:FindFirstChild(child.Parent.Name)
print("Username: "..player.Name)
end
end)

2 comments
FindFirstChild returns nil if it can't find what you're looking for. If there is no player in the game whose name is the child's Parent, you'll get nil. Nil does not have a name, so you can't print it out. Try printing child.Parent.Name first to see what you get.
Thanks.