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

How would I make a code only happen to a certain player as they join?

Asked by 4 years ago
game.Workspace.ChildAdded:connect(function(character)
 if game.Players:GetPlayerFromCharacter(character)~= nil then
    if character.Parent == "marioet77" then
        character.Head.Transparency = 1
    end
 end  
end)

How would I get a certain player's character to get this code then other players?? I'm new to characteradded

0
You should look into this: https://developer.roblox.com/en-us/api-reference/event/Players/PlayerAdded proqrammed 285 — 4y

1 answer

Log in to vote
2
Answered by
appxritixn 2235 Moderation Voter Community Moderator
4 years ago

If you only want to do this when a certain person joins, use this:

game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function()
        if player.Name == "name" then -- Change name to the player's name
            player.Character:WaitForChild("Head").Transparency = 1
        end
    end) 
end)

Cheers. Accept this if it helps you.

Ad

Answer this question