Control a body using one function from Module script

Hello there! I want to make something like Init function in Module script which controls the body given in parameters. The problem is every call variable that contains body changes by another one. How to create new loop everytime functions calls module script?

1 Like

What’s something that you need some help?
Show me your question of your script and send it to me I will look that is problem

That looks something like this:
Module:

function Init(body)
While true do
goTo(body,pos)
dealDamage(body,target)
etc.
end
end

Another script:
moduleScript:Init(script.Parent)

Look something really that I will think I will fix some is it later

Can we get the actual script please?

I dont think it requeres actual script.