#Connect is not a valid member of Players Players

6 messages · Page 1 of 1 (latest)

wild gazelle
#

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)

muted ember
#

which error

dull fog
#

Right now your just doing the service which makes no sense to the script

wild gazelle
#

ok ill see if it works

#

yes it worked thank you 🧌