Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to know if a specific player is in the server?

So i am planning to make an horror game. I don't know to script very well. I just wanna add a feuture that detects when a player is in the server, And make everything red when the player is in the server. (You don't have to make everything red tho, i know how to do that. )

I don't know how to script like this. Maybe some help?
Sorry for my bad english.

1 answer

✓ Accepted answer

ok

game.Players.PlayerAdded:Connect(function(player)
    if player.Name == "enternamehere" then
          game.Lighting.OutdoorAmbient = Color3.fromRGB(255, 0, 0)
    end
end)

game.Players.PlayerRemoving:Connect(function(player)
    if player.Name == "enternamehere" then
          game.Lighting.OutdoorAmbient = Color3.fromRGB(0, 0, 0)
    end
end)

8 comments

0

Can you please explain to him what this means and how it works so he understands it?

0

literally it just makes the outdoor ambient red, making it "look" like everything is red

0

Can you also turn the ambient back to narmal when he leaves?

0

And explain it in depth?

0

This script checks if any of the players are this person, and if so, turn ambient color to red

0

But please change it so the ambient goes back to normal when the player leaves.

0

Ok!

0

I think the script itself is pretty self-explanatory. Doesn't really need explaining. PlayerAdded, as in player joined the game, use an if statement to check for a name then if name is found, edit the lightning outdoor ambient.

This discussion is preserved as it was. New answers, comments, and votes are closed.