Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

CharacterAdded is not a valid member of Players?

Asked by 4 years ago
Edited 4 years ago
local Players = game:GetService("Players")

Players.CharacterAdded:Connect(function(player)

It's located in ServerScriptService btw

1 answer

Log in to vote
2
Answered by 4 years ago

Your problem: You need the player to get the character

Your solution:

local Players = game.Players
Players.PlayerAdded:Connect(function(p)
    p.CharacterAdded:Connect(function(char)
        char.Torso.Transparency = .5
        -- code goes here.....
    end)
end)
0
Dope, code goes but it only does everything once, when I had it all under playeradded it would continuously execute the code within it, now under character added it does it once or not at all Jedi_Yoda 0 — 4y
0
try using a coroutine or a loop to fix the problem Jedi_Yoda, the coroutine will yield out the character added, which then "Might" fix the problem, but when you put a loop, it will go on forever, and always check if the character has been added! greatneil80 2647 — 4y
0
you might use game.Players.LocalPlayer.CharacterAdded:Connect(function(character) too cherrythetree 130 — 4y
0
You just renamed the parameter cherrythetree.............................. greatneil80 2647 — 4y
Ad

Answer this question