#module script question

1 messages · Page 1 of 1 (latest)

stray granite
#

when i call test from another script it dosent modify playerHP!

#

so i have local script A that calls main() and local script B that calls test() but for some reason that dosent modify PlayerHP in script A

stray granite
#

Arent module scripts variables not shared through different scripts?!?!?

tall burrow
tall burrow
#

like

#

make a new Script instance

#

check the property

#

"RunContext"

stray granite
#

oh like local and server?

tall burrow
#

useful if you want to do something like run a localscript in replicatedstorage

tall burrow
stray granite
#

theyre both local though

#

so it should change, why dosent it?

tall burrow
#

havent read through the post yet, i just saw that message to reply lol
also are you the same person from yesterday

stray granite
#

yes 🥲

#

and what do you mean you havent read through the post

tall burrow
#

not the above

stray granite
#

oh

#

okay let me explain

tall burrow
#

you have a localscript that calls main() and another one that calls "test"
but the hp doesnt update on the first localscript that calls main from what im seeing?

stray granite
#

Yerg

tall burrow
#

try printing the hp on both scripts, see what the hp is from their perspective

stray granite
#

alright

#

ill try when i get home

stray granite
#

looks like one actually registers the damage but the other dosent change

#

im utterly clueless as to what i have to do now

#

if i put this as nil:

#

when test fires this error shows

#

which means playerStats.HP is nil on the other script

#

why?!?!???!