If you read my comment above, you've probably figured out the problem. What I'll do to help is show you the best ways to fix your script.
First, whenever you come across problems like these, the best way you can deal with them is to follow these specific steps:
Locate the problem - We'll find out what the problem is and *where * it is
Discuss the problem - Next, we'll discuss what might be the error
Solve the problem - We'll put together everything we've said in the discussion and implant the solution into the script
Those are the three main steps we as a community should take when were asking and answering questions.
Now that we know these *steps to success *, let's use them. First off, let's focus on the first step;Locate the problem...
In line 1, the script errors and says that it "attempts to index a table/array" or something like that :/.
Ok, next let's discuss why it's erroring...
Since the GetChildren method holds values, it can't define or operate (change) all the values as a whole. For in example, if we had a table named "TableValues" that is holding two values, one being a part and the other being an IntValue (# value). If we do TableValue.Character, it would error, because no all of the values within that table have the child/property ".Character".
Now how do we implant this onto our script...?
We know that we're using tables and that we can't operate on a table as a whole, we have to index specifc (specify) values in that table - so we'd use an Iteration (more on iterators here ---> http://wiki.roblox.com/index.php?title=Generic_for) specificly, we'd use the for i,v in pairs() do .
Table = game.Players:GetChildren()
for i,v in pairs(Table) do
local player = v
end
So the everything together would look something like this...
player = game.Players:GetChildren()
for i,v in pairs(player) do
repeat wait() until v.Character ~= nil
local playercharacter = v.Character
repeat wait() until game.Workspace:FindFirstChild("WinerMessage")~= nil
if game.Workspace:FindFirstChild("WinerMessage")~= nil then
playercharacter.Humanoid.Health = 100
end
Hopefully all this made since and helped a lot. If you have any other questions, comments, or suggestions drop a comment down below. Otherwise, I have some links to the wiki that will hopefully help a bit:
Roblox wiki
Tables
GetChildren
1 comment
The "GetChildren" method returns (outputs) a table (a list of values), so there are no properties/children of that table (as a whole). Find out more about tbales here ----> http://wiki.roblox.com/index.php?title=Table