#is this good way to do inventory
1 messages · Page 1 of 1 (latest)
why do you use datastore if u haev profile store
also why is buying item inside ur inventory module script?
ur inventory module should only have stuff that manipulates the inventory not purchasing something from the store
If it fires to the client when something changes your perfectly fine
Just make limits to how fast something can change
Just simple denounce
all the actions update the module script
and then the rest of it is finding a way to sync the module script with the game
idk am still figure out profilestore xd
ok
yes but are u putting the buy function inside the inventory module?
sorry for confusing layout. i just mean they click on a gui and buy whatever they intend. buying then adds that item to the module
the module then gets update and fires event and so on is my plan
oh ok yeah seems right
is good way to do it? are there better ways
the way u describe it seems very general. if you list specifics on how youre gonna do the purchasing i could help
i am honestly not sure yet i will figure out as i go xd
i just plan to have a basic purchase script where they can buy something and it adds it to their module
and then somehow it detects when their module updates and fires an event
and that event starts a script that updates their inventory somehow 🪦
Like a whole script for purchase itself? Seems kinda excessive but you do you
Ye that’s basically all it is
wdym?
like purchase should really just be 1 function in a whole module
for me at least
its js a check
if money enough -- > datamodule:minusGold(100) -- >inventory module:additem('sword')
it's not good to store player's inv stuff in a module
coz every player who join has a copy of that module so the module data just get copied to another player
each player that joins will be added to the module and have their own inv
** You are now Level 4! **
YAY!!!!
use profilestore bro
its a module btw
if it's in replicated storage then exploiters can access all player's inv