#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)

stable jasper
#

I need help to import things from Cartas on moduelscript

red stirrup
stable jasper
#

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

red stirrup
stable jasper
#

import things from cartas to module script to cardspawnclient

bleak saffron
#

That's what modules do

stable jasper
jovial starBOT
#

studio** You are now Level 2! **studio

stable jasper
#

?

bleak saffron
#

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

stable jasper
#

for it

bleak saffron
#

It depends on how you're doing it

red stirrup
stable jasper
#

ok

#

I think I will need to use global variables then

#

ty

red stirrup
#

Luau does have regular OOP you might be used to in other languages

red stirrup
stable jasper
#

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

red stirrup
#

Yes you can pass most variables through events

stable jasper
#

you mean remote events

#

?

#

can I pass from the server to the player?

red stirrup
#

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

stable jasper
#

So, I can use server -> client on remoteevent? didnt know that

#

tysm

red stirrup
#

Of course and best of luck 🫡

stable jasper
#

How can I put a name on the functions?

#

if its written this way