Tynexx
|
  |
| Joined: 11 Jul 2012 |
| Total Posts: 1559 |
|
|
| 18 Jul 2014 02:10 AM |
Around there, there is: for i,v in pairs(p.CharacterStats.HairStyle:GetChildren()) do if Auto_Load then if v.className=="Vector3Value" then v.Value = Vector3.new(DataStore:GetAsync(v.Name)) elseif v.className=="CFrameValue" then v.Value = CFrame.new(DataStore:GetAsync(v.Name)) elseif v.className=="BrickColorValue" then v.Value = BrickColor.new(DataStore:GetAsync(v.Name)) else v.Value=DataStore:GetAsync(v.Name) end end end
In another script, I try doing this game.Workspace.Players.Player1.CharacterStats.HairStyle_Scale.Value = Vector3.new(1.05,1.05,1.05) ~Tynexx |
|
|
| Report Abuse |
|
|
Tynexx
|
  |
| Joined: 11 Jul 2012 |
| Total Posts: 1559 |
|
| |
|
Tynexx
|
  |
| Joined: 11 Jul 2012 |
| Total Posts: 1559 |
|
|
| 18 Jul 2014 02:26 AM |
Fixed! CFrame.new(Vector3.new()) ~Tynexx |
|
|
| Report Abuse |
|
|
|
| 18 Jul 2014 03:19 AM |
| How are you saving/loading everything? |
|
|
| Report Abuse |
|
|
Tynexx
|
  |
| Joined: 11 Jul 2012 |
| Total Posts: 1559 |
|
|
| 18 Jul 2014 12:58 PM |
I am saving it with DataStore.. Why? ~Tynexx |
|
|
| Report Abuse |
|
|
|
| 18 Jul 2014 01:30 PM |
I mean.
Is it saved as "X, Y, Z", {X, Y, Z}, {x = X, y = Y, z = Z}? |
|
|
| Report Abuse |
|
|
Tynexx
|
  |
| Joined: 11 Jul 2012 |
| Total Posts: 1559 |
|
| |
|
| |
|
Tynexx
|
  |
| Joined: 11 Jul 2012 |
| Total Posts: 1559 |
|
| |
|
Tynexx
|
  |
| Joined: 11 Jul 2012 |
| Total Posts: 1559 |
|
| |
|
|
| 18 Jul 2014 04:02 PM |
| You might not be able to do what you are doing. You might have to store it as a table which you then unpack. |
|
|
| Report Abuse |
|
|
Tynexx
|
  |
| Joined: 11 Jul 2012 |
| Total Posts: 1559 |
|
| |
|
|
| 18 Jul 2014 06:53 PM |
| IDK if it can save CFrames or Vector3s. |
|
|
| Report Abuse |
|
|
Tynexx
|
  |
| Joined: 11 Jul 2012 |
| Total Posts: 1559 |
|
| |
|
Tynexx
|
  |
| Joined: 11 Jul 2012 |
| Total Posts: 1559 |
|
|
| 18 Jul 2014 06:57 PM |
Your right, 'Values can be numbers, booleans, strings, or Lua tables. However, values cannot be ROBLOX types like Vector3, Instance, or Part.' I'll save it with tables then. ~Tynexx |
|
|
| Report Abuse |
|
|
Tynexx
|
  |
| Joined: 11 Jul 2012 |
| Total Posts: 1559 |
|
|
| 18 Jul 2014 07:25 PM |
I have no idea if I'm doing this right: statsname = "CharacterStats" local strings = {"HairStyle_MeshId","Face_Texture"} local cframes = {"HairStyle_CFrame"} local vector3s = {"HairStyle_Scale"} local colors = {"Skin","HairStyle_Color"} local DS = game:GetService("DataStoreService"):GetDataStore("CharacterStats") game.Players.PlayerRemoving:connect(function(p) DS:UpdateAsync(plr.userId, function() values = {} values[1]=bag.HairStyle_MeshId.Value values[2]=bag.HairStyle_CFrame.Value values[3]=bag.HairStyle_Scale.Value values[4]=bag.Face_Texture.Value values[5]=bag.Skin.Value values[6]=bag.HairStyle_Color.Value end) end) game.Players.PlayerAdded:connect(function(p) if not (DS:GetAsync(plr.userId)) then DS:SetAsync(plr.userId, {}) end local valuesDS = DS:GetAsync(p.userId) local box = Instance.new("Model", p)--Sets where stats are. box.Name = statsname for i,v in pairs(strings) do --Insert Strings. local currency = Instance.new("StringValue",box) currency.Name = v end for i,v in pairs(cframes) do--Insert CFrameValues local currency = Instance.new("CFrameValue",box) currency.Name = v end for i,v in pairs(vector3s) do--Insert Vector3Values local currency = Instance.new("Vector3Value",box) currency.Name = v end for i,v in pairs(colors) do--Insert BrickColorValues local currency = Instance.new("BrickColorValue",box) currency.Name = v end --Give them there values local bag = p:FindFirstChild(statsname) if bag then bag.HairStyle_MeshId.Value = valuesDS[1] bag.HairStyle_CFrame.Value = CFrame.new(valuesDS[2]) bag.HairStyle_Scale.Value = Vector3.new(valuesDS[3]) bag.Face_Texture.Value = valuesDS[4] bag.Skin.Value = BrickColor.new(valuesDS[5]) bag.HairStyle_Color.Value = BrickColor.new(valuesDS[6]) end while wait(60) do valuesDS[1]=bag.HairStyle_MeshId.Value valuesDS[2]=bag.HairStyle_CFrame.Value valuesDS[3]=bag.HairStyle_Scale.Value valuesDS[4]=bag.Face_Texture.Value valuesDS[5]=bag.Skin.Value valuesDS[6]=bag.HairStyle_Color.Value end end) ~Tynexx |
|
|
| Report Abuse |
|
|