- Edited
It sounds like you're trying to use Godot 3 code with Godot 4, or vice versa. There were many changes from Godot 3 to Godot 4, including the parameters for methods like set_cell().
https://docs.godotengine.org/en/3.6/classes/class_tilemap.html#class-tilemap-method-set-cell
https://docs.godotengine.org/en/4.3/classes/class_tilemap.html#class-tilemap-method-set-cell
Use Help / About to see the exact Godot version you're using, and ensure that you're using the documentation for that version.