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

How to make a game sense a Users Player ID?

Asked by
IcyEvil 260 Moderation Voter
9 years ago

I need it for my game, so that the Developers can get Extra Features, This would be used in order so a Hacker can not access The Devs features Easily, But The Problem Is I dont know how, Any help in a script or something would be helpful.

1 answer

Log in to vote
0
Answered by 9 years ago

Hello. Your request is simple and easy. First way is, if you are using a PlayerAdded function you can do:

game.Players.PlayerAdded:connect(function(player)
    local playerid = player.userId
end)

or, another way is with a LocalScript... You can do: local playerid = game.Players.LocalPlayer.userId

I hope this answered your question!

UserId Player


For your "Dev Features", you can change their names in the script to their IDs and then where your script says something of the sort as player.Name you can change to player.userId.

0
I will try this out. IcyEvil 260 — 9y
0
The problem with using a LocalScript to determine whether the player is an admin or not is that exploiters can modify their ID locally and fool your admin script. wrenzh 65 — 9y
0
When did that become a thing? ROBLOX needs to patch that! userId property is ROBLOXLocked meaning it isn't accessible by script or LocalScript. TheStudentPilot 75 — 9y
Ad

Answer this question