put this in starterplayer or startercharacter, rename part to ur part
-- difine localplayer
local local_player = game:GetService('Players').LocalPlayer
local debounce
workspace.part.Touched:Connect(function()
-- debounce logic to avoid the code firing multiple times
if not debounce then
debounce = true
delay(1, function()
print(local_player.Name .. 'has won')
debounce = nil
end)
end
end)
-- difine localplayer
local local_player = game:GetService('Players').LocalPlayer
local debounce
workspace.EasyObby.EasyWinPart.Connect(function()
-- debounce logic to avoid the code firing multiple times
if not debounce then
debounce = true
delay(1, function()
print(local_player.Name .. 'has won')
debounce = nil
end)
end
end)