How to print Username based from UserID from my script? (not a basic question about UserID/Username)
Asked by
6 years ago Edited 6 years ago
So, hey 'der!
I've found a script on roblox for free which helped me out. The script is used to ban people from my game. However, i'd like to get their Username too from their Userid (I ban them if their userid match from the bannedlist)
Example of the script below.
01 | bannedplayerid = script.UserID.Value |
02 | banreason = script.BanReason.Value |
03 | anonymousbanner = false |
06 | note = script.BanAppeal.Value |
08 | Alert = script.Parent.Alert |
09 | Alert 2 = script.Parent.Alert 2 |
11 | BanStat = script.BanStatus.Value |
15 | game.Players.PlayerAdded:connect( function (instance) |
17 | if instance.UserId = = bannedplayerid then |
19 | if not enforceban = = false then |
21 | if secretban = = false then |
23 | if BanStat = = true then |
25 | if Alert.Playing = = false then |
31 | if anonymousbanner = = true then |
32 | ( HERE IS THE BANLINE THAT KICKS PEOPLE ) |
34 | ( HERE IS THE BANLINE THAT KICKS PEOPLE ) |
At the line where it says "( HERE IS THE BANLINE THAT KICKS PEOPLE )" i'd like to place a line that would create a message like "Dear " ..Username.. ". You have been banned" -- And more text.
I would like that Username would be the username from ID and not the name from the script.
I've done some research through google and official roblox wiki thing. But i couldn't figure it out.
It would be nice if you guys could help me :-)
EDIT:
Can i also add a line that would a badge to the player by playerid?
Thanks :-)