|
| 16 Jun 2016 03:06 PM |
How would i make it so i can save a players base that they placed, into Datastore?
|
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 16 Jun 2016 03:07 PM |
I would save the CFrame of the PrimaryPart so that you can easily just Model:SetPrimaryPartCFrame() it back
|
|
|
| Report Abuse |
|
|
|
| 16 Jun 2016 03:08 PM |
I tried, but when i saved the CFrame, it told me DStores cant hold Dictionaries.
|
|
|
| Report Abuse |
|
|
BanTech
|
  |
| Joined: 31 Dec 2015 |
| Total Posts: 886 |
|
|
| 16 Jun 2016 03:18 PM |
| You can't save the actual CFrame construct, but you can save individual values to recreate the CFrame later. Try creating a table of the CFrame's components |
|
|
| Report Abuse |
|
|
|
| 16 Jun 2016 03:47 PM |
similar to this?
PlayerData.PlacedItems[Item.Name.."0"] = PlayerData.PlacedItems[Item.Name.."0"] or {} PlayerData.PlacedItems[Item.Name.."0"]["X"] = PlayerData.PlacedItems[Item.Name]["X"] or 0 PlayerData.PlacedItems[Item.Name.."0"]["Y"] = PlayerData.PlacedItems[Item.Name]["Y"] or 0 PlayerData.PlacedItems[Item.Name.."0"]["Z"] = PlayerData.PlacedItems[Item.Name]["Z"] or 0 PlayerData.PlacedItems[Item.Name.."0"]["R"] = PlayerData.PlacedItems[Item.Name]["R"] or 0 ??
|
|
|
| Report Abuse |
|
|
BanTech
|
  |
| Joined: 31 Dec 2015 |
| Total Posts: 886 |
|
|
| 16 Jun 2016 03:52 PM |
That's one way to do it. You'll need more than just R for the rotation though. Remember that CFrames use 12 values.
CFrame.new(x, y, z, R00, R01, R02, R10, R11, R12, R20, R21, R22) |
|
|
| Report Abuse |
|
|
ray_1
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 464 |
|
|
| 16 Jun 2016 03:53 PM |
transform the cframe into quaternion form so there will only be 7 values
Recommended username: GullibleRay_1
|
|
|
| Report Abuse |
|
|
|
| 16 Jun 2016 04:10 PM |
i.e? example would be nice sorry im not that all intelligent :P
|
|
|
| Report Abuse |
|
|
| |
|