How to make a script editor

i want my game to have a script editor(like bedwars for example) that the player can write the script and when he saves it it does what he wrote in the script editor