how do you make a certain plot become yours when it touches a part and how do you save your plot?
- Make folder to repStorage which have models, you want to save.
- Cool if you use profileservice to save data
- When player is leaving, save data to table with unique name
For example:
data.Plot = {
"Home",
"Tree",
"Tree"
}
How to do that?
for _, v in pairs(workspace.(PlayerName)Plot:GetChildren())
table.insert(data.Plot, v.Name)
end
To save position
data.Plot = {
"Home" = {CFrame = "cframe"},
"Tree" = {CFrame = "cframe"},
"Tree" = {CFrame = "cframe"}
}
Next, make script which will load data, if player own any plot
if you’re saving with pos, get index with for-do
If you’re not, just take value - no difference
Then make script something like that
for i, v in pairs(data.Plot) do
local ModelToSpawn = game.ReplicatedStorage.Models:FindFirstChild(i):Clone()
if ModelToSpawn then
ModelToSpawn.PrimaryPart.CFrame = v.CFrame
ModelToSpawn.Parent = workspace:FindFirstChild(Player.Name.."Plot")
end
end
can you explain more clearly? I didn’t understand what profile service is
but how do I make a part become yours after touching?
I can to try make template for that. You can learn then by ready project.