#how do i make the shop items be synced with all servers?

84 messages · Page 1 of 1 (latest)

stoic peak
lyric pier
stoic peak
#

like if you switch server there is different items

#

in the shop

#

how do i fix that

lyric pier
#

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

wispy edge
# stoic peak

You could write your own random generation function

#

That takes in the current hour

#

And spits out a list of shop items

lyric pier
#

there already exists one, u should be able to put in a time value into math.random

stoic peak
lyric pier
wispy edge
stoic peak
#

this thing so complicated

lyric pier
#

i havent coded in roblox for a while

stoic peak
wispy edge
wispy edge
#

Don't

lyric pier
stoic peak
#

hold on ima show you what i got

wispy edge
#

With my way there's no need to do anything related to cross server synchronization

lyric pier
#

essentially, the function will always give you the same output with the same input, but it is mostly random

wispy edge
#

All you gotta do is write a loop

lyric pier
#

all the servers just put in the current hour

stoic peak
#

those all work

#

but

#

the items are different

#

in every server

#

how do i send it to the others

wispy edge
stoic peak
stoic peak
#

but then how i sync the items with all shops

wispy edge
#

You dont

stoic peak
#

its just random shops in all servers

wispy edge
#

That's the cool thing

stoic peak
#

breh

#

what

wispy edge
#

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

stoic peak
#

tbh i have no idea how it works

#

can you send me example please

wispy edge
#

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
stoic peak
#

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

lyric pier
#

the same way you did it so far whoknows

wispy edge
hallow spear
wispy edge
autumn orioleBOT
#

studio** You are now Level 26! **studio

hallow spear
#

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

wispy edge
#

Not handpicked

hallow spear
#

Then thats def the best option

lyric pier
#

cross server communication can be more efficient especially if the system gets more complex

#

but it is significantly harder to implement

lyric pier
#

creating a data storage is more complicated than sending a string

hallow spear
#

Messaging service is weird and i'd rather be retrieving data then waiting for a message

lyric pier
#

wdym

#

u still have to upload the data

#

the same way u have to upload the string

#

strings easier than a table

hallow spear
#

What about new servers?

#

You'll have to send a message to every new server

lyric pier
#

u got me

hallow spear
#

MemoryStores would just be easier

lyric pier
#

didnt think of that