Hello, I am currently working on a slocking system. The system works with splits and will work like If the Player will get a Higher Rank than the “Minimum Rank To Slock” then it will fire a UI for all Clients with a little notification. But they shouldn’t be able to slock for higher ranks than they are, so even if I try locking for a higher rank it is firing the RemoteEvent and slocking the server. If you know a way how to help me then feel free to post a comment.
local GroupId = 12345
local MinimumRankToSlock = 11
local SetSlock = 0
local RemoteEvent = game:GetService("ReplicatedStorage"):WaitForChild("slock")
game.Players.PlayerAdded:Connect(function(Player)
Player.Chatted:Connect(function(Message)
local split = Message:split(" ")
if split[1] == "!slock" then
if Player:GetRankInGroup(GroupId) >= MinimumRankToSlock then
if split[2] <= Player:GetRankInGroup(GroupId) or split[2] == Player:GetRankInGroup(GroupId) then
SetSlock = split[2]
RemoteEvent:FireAllClients(split[2])
end
end
end
end)
if Player:GetRankInGroup(GroupId) <= SetSlock then
Player:Kick("This server is locked!")
end
end)