Hello,
I'm currently working on an RPG MMO game, and I'm trying to make a quest system with an exchange. For example: Earn 20 gold for 300 xp. So I have a LocalScript
in the TextButton
in a ScreenGui
and the script is:
local player = game.Players.LocalPlayer script.Parent.MouseButton1Click:Connect(function() if player.leaderstats.MobKills.Value >= 50 then player.leaderstats.Coins.Value = player.leaderstats.Coins.Value + 10000 player.leaderstats.MobKills.Value = player.leaderstats.MobKills.Value - 50 script.Parent.TextSize = 22 script.Parent.Text = "Quest Commpleted" script.Disabled = true end end)
So if the player has 50 MobKills then they can exchange for 10000 Coins, this works and it updates, however it doesn't save, so when the player rejoins the game it will go back to what it was before if they hadn't clicked on the quest.
I'm not sure why it doesn't save, and I would really appreciate some help. Thanks!
You're going to have to use datastores to save data instead, this is (probably) the only way to save data when a player exits. Link: Datastores DM me at The Overseer#0001 if you need any help. Datastores only work if you have a script not a localscript, so you will have to use remote events.