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

Line: 7 Error CharacterAdded is not a member of Player. why is this happening?

Asked by 5 years ago

Here is the code, Roblox wiki says the same thing as this code I can't seem to figure it out!

local function onCharacterAdded(character)
    local Win = Instance.new("BoolValue")
    Win.Name = Win
    Win.Parent = character
end

game.Players.CharacterAdded:Connect(onCharacterAdded)
0
This is stopping my progress in making my game because this is such an important aspect of the game (It may not seem major but trust me it is.). MarkHasReset 77 — 5y

1 answer

Log in to vote
1
Answered by 5 years ago

You'll have to specify the player themselves. I hope this helps!

game.Players.PlayerAdded:connect(function(player)
    player.CharacterAdded:connect(onCharacterAdded)
end)
0
Oh I got it all wrong MarkHasReset 77 — 5y
0
also you forgot the function in player.CharacterAdded:Connect(function(onCharacterAdded) MarkHasReset 77 — 5y
Ad

Answer this question