generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: [HELP ME] The placement system is done - How do i save data?

Previous Thread :: Next Thread 
zoephixical is not online. zoephixical
Joined: 04 Nov 2011
Total Posts: 2555
30 Jun 2017 02:32 PM
[HELP ME] The placement system is done - How do i save data?

It functions correct, you can buy furniture from the shop and place it from your inventory on your plot using a kind of Tycoon ownership. The only thing is that i don't know how to make it so it saves the models that are placed on the tycoon once they rejoin or press save and then press Load


Report Abuse
Negativize is online. Negativize
Joined: 02 May 2011
Total Posts: 25068
30 Jun 2017 02:35 PM
You can store the model's data and save/load it when the player saves/loads or leaves/rejoins.
Report Abuse
Practically is not online. Practically
Joined: 14 Dec 2011
Total Posts: 8
30 Jun 2017 02:36 PM
Player:SaveInstance(key,model)

and

Player:LoadInstance(key)
Report Abuse
zoephixical is not online. zoephixical
Joined: 04 Nov 2011
Total Posts: 2555
30 Jun 2017 02:43 PM
i still don't know how/where to save it to


Report Abuse
zoephixical is not online. zoephixical
Joined: 04 Nov 2011
Total Posts: 2555
30 Jun 2017 02:47 PM
game.Player.PlayerAdded:connect(function(plr)
plr:LoadInstance(key)
end)

game.Players.PlayerRemoving:connect(function(plr)
plr:SaveInstance(key,model)
end)


Report Abuse
Negativize is online. Negativize
Joined: 02 May 2011
Total Posts: 25068
30 Jun 2017 02:47 PM
'Player:SaveInstance(key,model)

and

Player:LoadInstance(key)'

Isn't this deprecated?
Report Abuse
rennoc100 is not online. rennoc100
Joined: 24 Dec 2011
Total Posts: 9
30 Jun 2017 02:47 PM
do you mean something like this?

game.Player.PlayerAdded:connect(function(plr)
plr:LoadInstance(key)
end)

game.Players.PlayerRemoving:connect(function(plr)
plr:SaveInstance(key,model)
end)
Report Abuse
Practically is not online. Practically
Joined: 14 Dec 2011
Total Posts: 8
30 Jun 2017 02:51 PM
With the loadinstance, do


FurnitureModel = plr:LoadInstance(key)

FurnitureModel:MoveTo(anywhere)


Report Abuse
rennoc100 is not online. rennoc100
Joined: 24 Dec 2011
Total Posts: 9
30 Jun 2017 02:54 PM
so what do you mean with key?
Report Abuse
zoephixical is not online. zoephixical
Joined: 04 Nov 2011
Total Posts: 2555
30 Jun 2017 02:54 PM
Like this?

game.Player.PlayerAdded:connect(function(plr)
FurnitureModel = plr:LoadInstance(key)
end)

game.Players.PlayerRemoving:connect(function(plr)
FurnitureModel:MoveTo(anywhere)
end)


Report Abuse
Disillusions is not online. Disillusions
Joined: 10 Jul 2011
Total Posts: 6365
30 Jun 2017 09:15 PM
@Practically have you been living under a rock?

Easiest way imo is to save the cframe components of a hitbox for each furniture piece in a table, then put that in another table and save that

local itemstosave = workspace.items

function save()
local tabletosaveto = {}
for i, v in pairs(itemstosave:GetChildren()) do
table.insert(tabletosaveto,{v.Name,v.PrimaryPart.CFrame:components()})
end
game:GetService('DataStoreService'):GetDataStore('blah'):SetAsync('key',tabletosaveto)
end

function load(tabletoload)
for i, v in pairs(tabletoload) do
local item = storagesomewhere:FindFirstChild(v[1])
local new = item:Clone()
new:SetPrimaryPartCFrame(CFrame.new(select(2,unpack(v))))
new.Parent = workspace.items
end
end


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image