nezvers

Godot change active script

Sep 16th, 2020
767
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var current_code:String
  2. onready var instance:Node
  3.  
  4. func get_code()->void:
  5.     current_code = instance.get_script().source_code
  6.  
  7. func set_code()->void:
  8.     instance.get_script().source_code = current_code
  9.     instance.get_script.reload(true)
RAW Paste Data