i have an end part that when touched the system will put a message in chat saying the player finished the game, but when it chat it chats like 50 times, please help ty
part touch script
script.Parent.Touched:Connect(function(part)
for i,v in pairs(game.Players:GetPlayers()) do
if part:IsDescendantOf(v.Character) then
game.ReplicatedStorage.ReachedEnd:FireAllClients(v.Name)
end
end
end)
message creator local script
game.ReplicatedStorage.ReachedEnd.OnClientEvent:Connect(function(plrName)
game.StarterGui:SetCore("ChatMakeSystemMessage", {
Text = "[Game] " .. plrName .. " Reached the end",
Color = Color3.fromRGB(255, 255, 255),
Font = Enum.Font.Cartoon,
TextSize = 18,
})
end)

4 comments
your right, also table.insert does not take the index anymore in the second parameter, so you only need the table and the value
evaera also should learn from you because she don't know how to make debounce on the comments
noob yapelize this guy is pro,
table.finddoes linear search, player that touched the part is very likely to be the first one to touch it again 5 times in a row cuz every limb, this guy inserts the player at start of table sotable.findwill find the player immediatelywhat no i though table.insert second parameter died