#how do i make the shop items be synced with all servers?
84 messages · Page 1 of 1 (latest)
what do u mean synced with all servers?
all the shops in all servers resets every hour
but i want the items to be synced as well
like if you switch server there is different items
in the shop
how do i fix that
oh i get what u mean
u could try to use messagingservice
that lets your servers communicate with eachother
although youll have to think of how to make only 1 server choose the items
You could write your own random generation function
That takes in the current hour
And spits out a list of shop items
there already exists one, u should be able to put in a time value into math.random
ye i have no idea how to
in that case take ObSp's approach
That way you won't need to use anything like messaging service or get into synchronization
this thing so complicated
I think it's Random.new??
but how do i choose which server chooses
math.random only works with a min and max
all of them do
hold on ima show you what i got
With my way there's no need to do anything related to cross server synchronization
essentially, the function will always give you the same output with the same input, but it is mostly random
All you gotta do is write a loop
all the servers just put in the current hour
those all work
but
the items are different
in every server
how do i send it to the others
Bruh did you read anything I said
honestly i just dont know how to do what you said
Use the Random.new function
but then how i sync the items with all shops
You dont
its just random shops in all servers
That's the cool thing
Since it's pseudo random( not completely random) the same items will be generated in every server
If you input the current hour
It'll get you the same output
Here
Every hour run a piece of code that:
- Gets the current hour
- inputs that hour into Random.new() to get a kinda random number
- With that number, write some small algorithm that picks items based on the number
part 1 and 2 sounds alright
idk how to get the part 3
cuz i want to put many commons rare epic etc
thats so confusing
the same way you did it so far 
How are you doing it rn
Thats honestly a cool way of doing things
Most efficient way to do it too since there's no cross server communication required(which can get really confusing)
** You are now Level 26! **
Agreed
Actually what about memory stores?
For an item shop if you want to handpick items you could use memory stores which would be less difficult then cross-communication
Yeah I think he wants them random tho
Not handpicked
Then thats def the best option
i wouldnt say the most efficient
cross server communication can be more efficient especially if the system gets more complex
but it is significantly harder to implement
thats more complicated than cross server communication lol
creating a data storage is more complicated than sending a string
Definitely a lot easier though
Messaging service is weird and i'd rather be retrieving data then waiting for a message
wdym
u still have to upload the data
the same way u have to upload the string
strings easier than a table
u got me
MemoryStores would just be easier
didnt think of that