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!
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)