m_acch
(Mach)
August 4, 2023, 11:33pm
#1
I feel like its complicated, I wanna make a blacklist script taking the usersid from a module.
Module
local blacklist = {
[1] = {
["Test"] = 131504927,
}
}
return blacklist
LocalScript
local Module = require(script.Parent.Module)
local Player = game:GetService("Players")
local Directory = script.Parent
if Player.LocalPlayer.UserId == Module[1] then
Directory.Alert.Enabled = false
Directory.Info.Enabled = false
Directory.MEF.Enabled = false
Directory.PlayerList.Enabled = false
Directory.Scoreboard.Enabled = false
game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.All, false)
Player.LocalPlayer.Backpack:ClearAllChildren()
end
1 Like
Haystees
(Haystees)
August 4, 2023, 11:40pm
#2
Why dont you just have the blacklist set up as an array?
local Blacklist = {
11111 -- userid
}
return Blacklist
Then you can just check if that userID is blacklisted by doing this:
local UserID = game:GetService("Players").LocalPlayer.UserID
if table.find(Blacklist, UserID) then
-- do whatever
end
m_acch
(Mach)
August 4, 2023, 11:43pm
#3
blacklist would redline, what am i missing that should be defined?
Haystees
(Haystees)
August 4, 2023, 11:45pm
#4
That was just an example so that you could set up your own variables but you need to make sure the blacklist module is defined somewhere.
local Blacklist = require(...) -- replace with whatever path you have it under
local UserID = game:GetService("Players").LocalPlayer.UserID
if table.find(Blacklist, UserID) then
-- do whatever
end
system
(system)
Closed
August 18, 2023, 11:47pm
#6
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.