#which is better?? using bindableEvent or exposing the function to other scripts ???

1 messages · Page 1 of 1 (latest)

unborn vault
#

im currently writing a dialogue system that uses a camera handler local script under the same parent of the dialogue handler local script.

when i suddenly realized that i could exposed the script's function to other local scripts, but for the whole time ive been devving my game, ive used bindable events to communicate server-to-server / client-to/client (espepcially for gameloop).

ive been wondering, while im not too deep in the game's development, which one is better practice between the two? which one is suitable for what kind of situation?

silk bison
#

but

#

if you got server script

#

u aint exposing function to localscript

#

but modulescript in place where both local and normal script can see

#

local could require module for its own like copy of it

#

so it would have seperate internal variables then one required by normal

unborn vault
# silk bison unsure if i understand correctly

sorry for the unclarity of the text buut i mean like

if i want to use a function in a script thats from a different script in the same context (server to server/client to client), which is better???

#

i have this code inside a local script because i want to expose it to other local scripts under the same parent

silk bison
#

cant u just make it into module :/

unborn vault
#

....fair point

#

alright, thanks man : ) really appreciate it

silk bison
#

np

eternal yoke
#

yo doooorb

#

do you know abt oop

#

@unborn vault

unborn vault
#

havent heard of it until now

#

although based on what im seeing i can kinda get it i guess

eternal yoke
#

its propably useful in your scenario if you have lets say 2 npcs with 2 diffrent dialoges

#

if you script more and diffrent things your gonna get the hang of it pretty easily

#

maybe its kinda difficult at the start

unborn vault
#

ohhhhhhhhh i think i get the concept

#

i think what i have been doing is somethign like that??? i dont know

eternal yoke
#

Modules are mostly used for oop so yea your kinda already doing it

#

how long have you been scripting for

unborn vault
#

for 4 years already i thiink

#

i started actually puttng focus in my scripting in 2021, although i frequently took breaks cuz high school

#

but ive dabbled in it beforehand when i was more on the building side

eternal yoke
#

alright

eternal yoke
#

if you ever get bored look into --!strict thats hella intresting, for me atleast