#Is it possible to call things from a parent script if I have a module script inside a normal script?
1 messages · Page 1 of 1 (latest)
I dont think you can call things from a regular script like you can from a module one, what are you trying to do?
Im trying to make a card game and the server has the script "cartas" that I was trying to import some things to my playerGUI script
this is my playerGUI script
I want that the server sends to the client which cards are on the player hand
and then when the player press the card and throws it to the arena it spawns a model
but I cant make it if the scripts dont communicate with other, I know that I need a modulescrpt to import things to other scripts but if I put these things on the module script it will simply not run unless I call it
Are you just trying to make scripts communicate with each other?
I want to import like I can do on other coding languages
import things from cartas to module script to cardspawnclient
That's what modules do
but how can I import things from my script.parent on modulescript
** You are now Level 2! **
?
As far as I know, there is no simple way to import things from a normal script, but you can communicate between scripts using events
Cant I use global variables?,
for it
It depends on how you're doing it
Thats not how module scripts work the essentially just return a table
Luau does have regular OOP you might be used to in other languages
I think you should communicate between scripts through events
can the events pass which card the player has on hand?
Like
I have 8 cards (#1,2,3 and go on)
the player has the cards on his hand: #4, #7, #1 and #2
how can I know that the first card is #4 by an event
Yes you can pass most variables through events
If you’re communicating from server to client or vice versa then yes remote events
If not consider bindable events that let you communicate between scripts
Of course and best of luck 🫡