At output it's prints nil, instead of my name ingame. Here is the code:
local playerToFind = hit.Parent.Name -- Hit is the way I find out what touched the brick. local playerService = game:GetService("Players") local player = playerService:FindFirstChild(playerToFind) print(player)
I really have no idea why, I hope someone can help me. - Toby
The problem is that at line 4, you didn't convert the name of the player. You can just do:
print(player.Name)