#Jailing system

1 messages · Page 1 of 1 (latest)

harsh pewter
#

I made 2 major custom commands:
:JailA <user>
And
:JailR <user/all>

#

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)

velvet anvil
#

replace the p: Player with the player instance of the player that's leaving jail and it should work

harsh pewter
#

I used

#

RunCommand = stringformat "timeban %s 4H reason

velvet anvil
harsh pewter
velvet anvil
#

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

harsh pewter
#

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??

velvet anvil
#

i have no idea what your code is so its going to be a little hard to suggest where to put it

harsh pewter
harsh pewter
# velvet anvil i have no idea what your code is so its going to be a little hard to suggest whe...

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