Alright so i have an issue. I have a baseball that when thrown will become a child of the workspace. What I want to do is when the baseball is a homerun, it will trigger a message with the person who hit it. I have all of that done except the part with the players name. I don't know how to get the players name who hit it because the parent of the baseball is the workspace.
debounce = false function onTouched(hit) local player = --this is where i need help if hit.Name == "Ball" and debounce == false then debounce = true local h = Instance.new("Message") h.Parent = hit.Parent h.Text = "Home run hit by"..player.Name wait(4) h.Parent = game.Workspace h:remove() debounce = false end end script.Parent.Touched:Connect(onTouched)
NAME_PLAYER the name of the player
for i, child in pairs(game.Workspace:GetChildren()) if child:IsA("Model") and child.Name == "NAME_PLAYER" then end end