Never messed around with tables before so this is confusing to me and there is no table. thing that says make the thing copiable or whatever so help would be appreciated!
The code is :
local plr = game.Players[script.Parent.Parent.Parent.Parent.Name]
local Char = plr.Character
local Monster = Char.IsMonster
local Remaining = script.Parent.Objective.Remaining
local AlreadyKilled = {}
while task.wait() do
if workspace.RoundStarted.Value == false then
for i in pairs(table) do
table[AlreadyKilled] = nil
end
end
end
while task.wait() do
script.Parent.Objective.Text = "Kill "..Remaining.Value.. " Humans as SANS."
if Monster.Value == true and workspace.RoundStarted.Value == true and plr.MoreData.MonsterType.Value == "Sans" then
for i,v in pairs(workspace.PlayersPlaying:GetChildren()) do
if v:IsA("Model") and v:FindFirstChild("Humanoid") then
local IM = v:WaitForChild("IsMonster")
if IM.Value == false then
repeat task.wait() until workspace.PlayersInRound.Value >=1
if v.Humanoid and table.find(AlreadyKilled, v.Name) then
continue
else
table.insert(AlreadyKilled, v.Name)
task.wait(.5)
Remaining.Value = Remaining.Value -1
v.Humanoid.Health = 100
end
end
end
end
end
if Remaining.Value == 0 then
plr.leaderstats.Gold.Value = plr.leaderstats.Gold.Value + 100
plr.leaderstats.EXP.Value = plr.leaderstats.EXP.Value + 100
Remaining:Destroy()
script.Parent.Objective.Text = ""
script.Parent.Reward.Text = ""
script.Parent.Parent.Enabled = false
plr.MoreData.CurrentQuest.Value = 1
script:Destroy()
end
end
The line erroring is line 11
table[AlreadyKilled] = nil
Help would be greatly appreciated thank you!