#Jailing system
1 messages · Page 1 of 1 (latest)
The way this basically works is
When the command is executed it teams the user into a Jailed team
Issue is
I also added a part that makes it so if you leave whilst in the jailed team, you get timebanner for 4 hours using the Adonis timeban command
But the ban part doesn't work!
(Mention me when someone answers)
you probably want to use the internal function instead which would be (2nd arg in the function is 4 hours in seconds):
server.Admin.AddTimeBan(p: Player, 4 * 60 * 60, "leaving jail")
replace the p: Player with the player instance of the player that's leaving jail and it should work
I'll try later
yeah this won't work as far as i know since the actual timeban command that gets ran if you use a command has some extra logic that checks if you're not lower than the rank you're banning for security reasons and won't work with runcommand
So i gotta put this exact part?
yeah just remove the runcommand logic with that and just modify it to your liking like replacing the p stuff and maybe changing the reason to the one you want
Whats the P stuff?
I mean
What Do You suggest putting?
Cuz i need it to be the player that leaves whilst teamed as Jailed
So should I put s% or??
i have no idea what your code is so its going to be a little hard to suggest where to put it
I'll show u tmrw cuz I don't have my PC rn
game.Players.PlayerRemoving:Connect(function(player)
local jailedTeam = game:GetService("Teams"):FindFirstChild("Jailed")
if player.Team == jailedTeam then
local AdminModule = _G.Adonis or require(game:GetService("ServerScriptService"):FindFirstChild("Adonis_Loader")).Server
local commandToRun = string.format(":timeban %s 4h You tried leaving the game whilst jailed, and have been automatically banned for 4 hours. If you wish to appeal, you can do so in our comms, code is in the game's description.", player.Name)
print("[DEBUG] Auto-banning jailed quitter:", player.Name)
-- Esegui il comando come "console"
AdminModule.Admin.RunCommand("Console", commandToRun)
end
end)
this is what I placed in the settings folder
Idk if I should move it in another script or what tho