I need to print out the player's name in the console when they touch a brick with their character, but my code doesn't work. can anyone help me solve this issue?
--variables
local brick = script.Parent
--functions
local function startLevel(player)
print(player.Name)
end
--code
brick.Touched:Connect(startLevel(otherPart))

3 comments
What if "hit" gets destroyed? What if hit isn't a player object? This would print on everything that happens to touch the object
Stop. Spoonfeeding. Period.
Looks like I did it too quickly. Fixed anyways, sorry!