You cannot test for an element in a list using the keyword "in" - you must use a for loop instead (ideally inside a function).
ex, the one I use:
function Contains(list, item)
if list == nil then return false end
for i = 1, #list do
if list[i] == item then return true end
end
return false
end
You have a few other problems with your script:
if "workspace.running" is a BoolValue, you need to say "workspace.running.Value = false" (ie assign to its "Value" property), not just "workspace.running = false" (which would attempt to set a property of the workspace to false -- except that the workspace doesn't have a "running" property)
Further, "character.Humanoid.Died" can only ever fire once because every time the player's character is reset, they get a new humanoid. You need to connect the new humanoid to the event. Roblox's leaderboard script does this, you may wish to take a look at it (in particular look at lines 143-146 for hooking up the events for OnPlayerAdded, and also look at the onPlayerRespawned function, which hooks up the new humanoid to the onHumanoidDied function. In your case, you'd replace "onHumanoidDied" with your function to add the player to the list of dead players.)
Also note that, in lua, you do not need parentheses around the condition of an if statement.
Be sure to check for syntax errors: Roblox has a "Script Analysis window" that would tell you of your syntax error on line 10. Attempting to run the script would likewise show you the syntax error in the Output window.
3 comments
Please provide evidence of the "everything I try", you speak of. (Provide scripts you have tried)
Give the user some time to at least edit the post before jumping straight to moderation
Ok, I put evidence.