Send a message in the chat when player touches the win part

Hello! I’m trying to make a long obby game where at the end once a player touches a part it sends a message in the chat along the lines of “Congratulations to “PlayerName” for completing the game!”

I’ve tried multiple methods but none seem to work. Thanks in advance!

1 Like

a simple search on yt should do the trick: How To Create COLORED SYSTEM MESSAGES With TextChatService (Roblox Studio) - YouTube

1 Like

That is definitely helpful but how would I send the player who touched the part’s name?

local PlayerName = ""
WinPart.Touched:Connect(function(hit)
	local Char = hit:FindFirstAncestorWhichIsA("Model")
	if Char then
		local Player = game.Players:GetPlayerFromCharacter(Char)
		if Player then
			PlayerName = Player.Name
		end
	end
end)

this should do the trick

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.