So basically I am trying to make a script that finds the last player(s) alive. By using StringValues but it seems not to work I don't know why.
` game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
Instance.new("StringValue", player)
end)
end)
function Alive()
local player = game.Players:GetChildren()
local D = player:findFirstChild("StringValue").Value == "Dead"
local A = player:findFirstChild("StringValue").Value == "Alive"
wait(1)-- game time
if A == true then
local Message = Instance.new("Message", workspace)
Message.Text = (A.Name.."is the last player left!")
end
end
Alive() `

5 comments
It still does not work I fixed the errors in it but I can't seem to get it to work :(
What is the error? @CorruptBullet
Sorry this is late but their is no error I have been working on it for days trying to reverse engineer it but still can't get it to work. @Shawnyg
@CorruptBullet Try setting up print() around the script. See where it stops
@Shawnyg I got it to work instead of a String value I used a IntValue and changed it up a bit and got it to work. Thanks anyways