# Writing from one .lua-script into another?

**URL:** <https://forums.solar2d.com/t/writing-from-one-lua-script-into-another/349648>\
**Category:** Newbie Questions\
**Created:** [March 24, 2019, 6:52pm UTC](https://forums.solar2d.com/t/writing-from-one-lua-script-into-another/349648 "2019-03-24T18:52:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![xazvre](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/x/e79b87/32.png) [@xazvre](https://forums.solar2d.com/u/xazvre)\
**Post date:** [March 24, 2019, 6:52pm UTC](https://forums.solar2d.com/t/writing-from-one-lua-script-into-another/349648/1 "2019-03-24T18:52:29Z")

</div>

Hello folks,

a little beginner question here.

Is it possible to have one function of one lua script write into an other lua script?  
(the other lua script should save the changes)

Smth like

if (this happens)

&nbsp;then (write THAT in .lua-script2)

end

I really want that this isnt temporary. I need lua-script2 to be permanently changed as long as another function is not activated.

---

<div class="post-metadata">

**Author:** ![rob](https://forums.solar2d.com/user_avatar/forums.solar2d.com/rob/32/4_2.png) [@rob](https://forums.solar2d.com/u/rob)\
**Post date:** [March 25, 2019, 3:51pm UTC](https://forums.solar2d.com/t/writing-from-one-lua-script-into-another/349648/2 "2019-03-25T15:51:24Z")

</div>

Welcome to our Community Forums.

You can have lua files to talk to each other however you can’t have Corona re-write code after it’s compiled. What you can do is save information and use that information with existing code to cause your code to have the behavior that you want.

Rob

---

<div class="post-metadata">

**Author:** ![rob](https://forums.solar2d.com/user_avatar/forums.solar2d.com/rob/32/4_2.png) [@rob](https://forums.solar2d.com/u/rob)\
**Post date:** [March 25, 2019, 3:51pm UTC](https://forums.solar2d.com/t/writing-from-one-lua-script-into-another/349648/3 "2019-03-25T15:51:24Z")

</div>

Welcome to our Community Forums.

You can have lua files to talk to each other however you can’t have Corona re-write code after it’s compiled. What you can do is save information and use that information with existing code to cause your code to have the behavior that you want.

Rob
