Basically the winner has to step on a brick to win, I tried adding a debounce but every time 2 people cross the brick the 2nd one who crossed wins, I tried turning can collide to false and cloning destroying and then setting the parent of the clone from replicated storage back to workspace after a certain amount of time, idk if I just did it wrong but help would be appreciated.
wait(15)
local DIDend = {game.Workspace.DEndPart, game.Workspace.SEndPart, game.Workspace.TEndPart, game.Workspace.Neon1EndPart, game.Workspace.DessertEndPart}
local Players = game:GetService("Players")
local PlayerName = game.StarterGui.PlayerWin.Frame.PlayerName
local PlayerWinValue = game.ReplicatedStorage.PlayerWinValue
for _,v in pairs(DIDend) do
v.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
PlayerWinValue.Value = hit.Parent.Name
end
local player = Players:GetPlayerFromCharacter(hit.Parent)
local userId = player.UserId
print (userId)
local thumbType = Enum.ThumbnailType.HeadShot
local thumbSize = Enum.ThumbnailSize.Size180x180
for i,v in pairs (game.Players:GetPlayers()) do
local imageLabel = v.PlayerGui.PlayerWin.Frame.PlayerAV
imageLabel.Image = Players:GetUserThumbnailAsync(userId, thumbType, thumbSize)
imageLabel.Size = UDim2.new(0, 180, 0, 180)
end
game.ReplicatedStorage.ShowGui:FireAllClients(game.Players:GetPlayerFromCharacter(hit.Parent))
wait(20)
end)
end
