I had a script that was working yesterday, came back today and now its giving this error
Heres the code for the function if it helps (plants vs zombies game)
local Players = game:GetService("Players")
local PhysicsService = game:GetService("PhysicsService")
Players:Connect(function(player)
local Sun = Instance.new("IntValue")
Sun.Name = "Sun"
Sun.Value = 0
Sun.Parent = player
local Brain = Instance.new("IntValue")
Brain.Name = "Brain"
Brain.Value = 0
Brain.Parent = player
player.CharacterAdded:Connect(function(character)
for i, object in ipairs(character:GetDescendants()) do
if object:IsA("Basepart") then
PhysicsService:SetPartCollisionGroup(object, "Player")
end
end
end)
end)