How can i make a tower shop for my game

I need to make a tower shop it need to save bought towers multiple places
Can somebody help me how can i make it?

1 Like

The best approach here would be to use a dictionary with the keys as the tower names and the values being dictionaries themselves containing data about the tower (level, is equipped, etc).

For example:

--// Handling for when they buy a tower
player_data = player_data or {}; --// player_data should be defined beforehand as the data retrieved from the DataStore

player_data["name of the tower"] = {
     level = 1,
     is_equipped = false
};

--// Now you can save it again

The dictionary can of course be iterated over and handled when they join a match.


FYI: DataStores are replicated across places of the same universe (game), nothing has to be done to do so.

As the devforum isn’t for spoon feeding scripts, so I don’t think someone is going to give a direct script that will work. But I would say you should learn the basic functions and services you would use for a shop.

One of the important one is DataStores.

1 Like

What i need to learn to make this script? remote events or what and yes i will try it

I believe you will use alot of concepts together, here are the API References to some of them that I would use:

You will have to use your knowledge on these concepts and come up with a good workflow for your shop.

1 Like

Ok I make your message as solution thanks for helping