events.JailPlayer.OnServerEvent:Connect(function(player, t, username)
game.Players:FindFirstChild(username).TeamColor = BrickColor.new('Mulberry')
game.Players:FindFirstChild(username):LoadCharacter()
events.Jailing:FireClient(username, t)
end)
22:37:12.751 - Unable to cast value to Object 22:37:12.759 - Stack Begin 22:37:12.761 - Script 'ServerScriptService.devARRESTServer', Line 4 22:37:12.769 - Stack End
Can someone please explain why it is doing this?
When firing the client it ask for the client you are firing :FireClient(playername, arguments) if I remember correctly
Username is returning as the name of the client I want to fire but for some reason it errors.
t returns as a number chose by the person arresting the player

1 comment
first argument of FireClient is the player object you're firing to. the username variable is a string. make a variable like: local newPlayer = game.Players:FindFirstChild(username), and use that in place of it