I need help with a Save Script

Hello developer community, I’m a beginner in this, and the only thing I know is to save “values”, and I couldn’t save this object. Who can help me with a script that saves the localscript changes for the object, please?

| LocalScript, “StarterPlayerScripts” |

game.Workspace.Prueba.Touched:Connect(function()
game.Workspace.Prueba.CanCollide = true
game.Workspace.Prueba.Transparency = 0
end)

| Image |

1 Like

:slight_smile: :slight_smile: <3

i dident really understand what you want

I’m confused on what you mean. Can you explain better please?

an autosave for the object, with the properties

im still confused can you explain what you want

Do you mean you want to save it when leaving the game? If it’s a LocalScript it won’t replicate.

In short, an autosave for this object with the characteristics of the localscript, so that when you re-enter the game the characteristics of the object are saved

Exactly what I mean, so how should it be?

1 Like

oh i get it data store is what you need watch this tutorial Advanced Roblox Scripting Tutorial #13 - Data Store / Saving Player Data (Beginner to Pro 2019) - YouTube

1 Like

You can try using datastores to make it save in all servers. If you only want it to save in one server, use tables.

1 Like

There is no way to save it since the script will execute it in the same way due to the assignment of properties so you have nothing to do, yet it will be saved and generated at the moment a player opens the game

This doesn’t work for me

local DataStore = game:GetService("DataStoreService")
local MyData = DataStore:GetDataStore("AutoGuardadoAreas")

game.Workspace.Prueba.Touched:Connect(function(plr)
game.Workspace.Prueba.CanCollide = true
game.Workspace.Prueba.Transparency = 0

MyData:GetAsync("Estadistica1-"..plr.UserId)

end)

game.Players.PlayerRemoving:Connect(function(plr)
local Dato1 = plr.leaderstats.Levels.Value
MyData:SetAsync("Estadistica1-"..plr.UserId, Dato1)

end)

It is not what I mean, you assigned a property to a part through a script so there is no way to save it also the part will be visible to all players since the script will execute everything in the same way but there is no way to save a part .

1 Like

What seems strange to me is how people in a game of simulators, for example, when they make a door to be bought, it disappears, that is saved

You mean a VIP door like thing?

they are not making use of filtering enabled which causes it to only be visible to one person

1 Like

No, for example Unboxing Simulator

Oh, I thought you meant a door that could be purchased via Robux. You mean a door that can be purchased through in game currency?

1 Like

When you buy the door with your coins, and that door disappears and is always saved

1 Like