function finish()
if #alive == 1 then
message = Instance.new("Message",game.Workspace)
message.Text = "The winner was "..alive[1].Name
alive[1].leaderstats.Wins.Value = alive[1].leaderstats.Wins.Value+1
data:SetAsync(alive[1].userId.."_data",alive[1].leaderstats.Wins.Value)
alive[1].Character:MoveTo(game.Workspace.SpawnLocation.Position)
for u, o in pairs(game.Players:GetPlayers()) do
o.Backpack:findFirstChild("FingerLazers"):Destroy()
end
table.remove(alive,1)
wait(2)
message:Destroy()
wait()
message:Destroy()
regenmap()
done = true
end
end
This should work, I get no errors but it isn't working. The FingerLazers is not destroying from my backpack and the game never ends
EDIT:
function finish()
if #alive == 1 then
message = Instance.new("Message",game.Workspace)
message.Text = "The winner was "..alive[1].Name
alive[1].leaderstats.Wins.Value = alive[1].leaderstats.Wins.Value+1
data:SetAsync(alive[1].userId.."_data",alive[1].leaderstats.Wins.Value)
alive[1].Character:MoveTo(game.Workspace.SpawnLocation.Position)
table.remove(alive,1)
wait(2)
message:Destroy()
wait()
message:Destroy()
end
regenmap()
done = true
end
This was the old code before my friend tried to fix it for me which worked absolutely fine with no troubles until I decided I wanted to add the lazer, now when I try and remove it from the player's backpack it doesn't work, and the game won't end.

1 comment