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

Anyone know how I can make a variable to get a players UserId and RoleId?

Asked by 3 years ago
Edited by Leamir 3 years ago

So I am trying to make an auto ranking bot, I have everything done apart from getting the users ID and their group RoleId, and as this is an army group I am making this for, I can't just hardcode it every time.

this is the script I have (it uses glitch.com):

local GlitchURL = "idf-ranking-bot.glitch.me" --Place the glitch project URL inside of the quotes

unction rankUser(UserId, RoleId)
game:GetService("HttpService"):GetAsync(GlitchURL .. "ranker?userid=" .. UserId .. "&rank=" .. RoleId)
end
local UserId = 12345 --Replace 12345 with the users userid
local RoleId = 255 --Replace 255 with the role id that you would like the user to be set to
rankUser(UserId, RoleId)

I need to change the local UserId and local RoleId into variables that can be taken from the game if they get promoted, and I can't figure out how. Ideas anyone?

1 answer

Log in to vote
0
Answered by
SirGamezy 186
3 years ago

When answering, if your answer does not fully solve the question, it should be written as a comment to the question instead of as an answer.

I know how to get the player's user id, but not the role id.

game.Players.PlayerAdded:Connect(function(player)
    local UserId = player.UserId
end)
0
so that would replace this part of the code: local UserId = 12345 --Replace 12345 with the users userid ? LeaderOblivion 0 — 3y
Ad

Answer this question