Why won't this script work?
I've tried to make a Data Store script, where you save the colors of a bring. However, the colors won't load on the part. Aaaand, when it checks if the player has loaded, nothing happens. (I've used tostring, mind you)
However, when i use the script, it shows no error (Btw, i made an update script too)
Aaand this is in a normal script, not a local script
(PS: Chest does NOT mean Torso!, Its a completely different model in the player that i'm indexing)
If i'm doing something wrong, let me know!
This is the save script
01 | local DataStore = game:GetService( "DataStoreService" ):GetDataStore( "NicuWolfSlot1" ) |
02 | local player = script.Parent.Parent |
05 | player.Character.Chest.Body.BrickColor, |
06 | player.Character.Chest.Chest.BrickColor, |
07 | player.Character.Chest.Neck.BrickColor, |
08 | player.Character.Chest.Tail 1. BrickColor, |
09 | player.Character.Chest.Tail 2. BrickColor, |
10 | player.Character.Chest.Tail 3. BrickColor, |
11 | player.Character.Chest.bodyfrontA.BrickColor, |
12 | player.Character.Chest.bodyfrontB.BrickColor, |
13 | player.Character.Chest.ear 1. BrickColor, |
14 | player.Character.Chest.ear 1 p 2. BrickColor, |
15 | player.Character.Chest.ear 1 p 3. BrickColor, |
16 | player.Character.Chest.ear 2. BrickColor, |
17 | player.Character.Chest.ear 2 p 2. BrickColor, |
18 | player.Character.Chest.ear 2 p 3. BrickColor, |
19 | player.Character.Chest.head.BrickColor, |
20 | player.Character.Chest.muzzle 1. BrickColor, |
21 | player.Character.Chest.muzzle 2. BrickColor, |
23 | player.Character.Leg 1. BackLLeg.BrickColor, |
24 | player.Character.Leg 1. FrontRpaw.BrickColor, |
25 | player.Character.Leg 1. FrontRLeg.BrickColor, |
26 | player.Character.Leg 1. ShoulderRback.BrickColor, |
27 | player.Character.Leg 1. ShoulderLfront.BrickColor, |
28 | player.Character.Leg 1. BackRpaw.BrickColor, |
30 | player.Character.Leg 2. BackRLeg.BrickColor, |
31 | player.Character.Leg 2. FrontLpaw.BrickColor, |
32 | player.Character.Leg 2. FrontLLeg.BrickColor, |
33 | player.Character.Leg 2. ShoulderLback.BrickColor, |
34 | player.Character.Leg 2. ShoulderRfront.BrickColor, |
35 | player.Character.Leg 2. BackLpaw.BrickColor, |
39 | local Colors = { "Institutional white" , "Really black" , "Reddish brown" , "Dark stone grey" , "Dark orange" , "Black" , |
40 | "Brick yellow" , "Nougat" , "Cool yellow" , "Bright yellow" , "Pastel yellow" , |
41 | "Medium stone grey" , "Mid gray" } |
43 | Body = tostring (player.Character.Chest.Body.BrickColor) |
44 | Chest = tostring (player.Character.Chest.Chest.BrickColor) |
45 | Neck = tostring (player.Character.Chest.Body.BrickColor) |
46 | Tail 1 = tostring (player.Character.Chest.Body.BrickColor) |
47 | Tail 2 = tostring (player.Character.Chest.Body.BrickColor) |
48 | Tail 3 = tostring (player.Character.Chest.Body.BrickColor) |
49 | bodyfrontA = tostring (player.Character.Chest.bodyfrontA.BrickColor) |
50 | bodyfrontB = tostring (player.Character.Chest.bodyfrontB.BrickColor) |
51 | ear 1 = tostring (player.Character.Chest.ear 1. BrickColor) |
52 | ear 1 p 2 = tostring (player.Character.Chest.ear 1 p 2. BrickColor) |
53 | ear 1 p 3 = tostring (player.Character.Chest.ear 1 p 3. BrickColor) |
54 | ear 2 = tostring (player.Character.Chest.ear 2. BrickColor) |
55 | ear 2 p 2 = tostring (player.Character.Chest.ear 2 p 2. BrickColor) |
56 | ear 2 p 3 = tostring (player.Character.Chest.ear 2 p 3. BrickColor) |
57 | head = tostring (player.Character.Chest.head.BrickColor) |
58 | muzzle 1 = tostring (player.Character.Chest.muzzle 1. BrickColor) |
59 | muzzle 2 = tostring (player.Character.Chest.muzzle 2. BrickColor) |
60 | BackLLeg = tostring (player.Character.Leg 1. BackLLeg.BrickColor) |
61 | FrontRpaw = tostring (player.Character.Leg 1. FrontRpaw.BrickColor) |
62 | FrontRLeg = tostring (player.Character.Leg 1. FrontRLeg.BrickColor) |
63 | ShoulderRback = tostring (player.Character.Leg 1. ShoulderRback.BrickColor) |
64 | ShoulderLfront = tostring (player.Character.Leg 1. ShoulderLfront.BrickColor) |
65 | BackRpaw = tostring (player.Character.Leg 1. BackRpaw.BrickColor) |
66 | BackRLeg = tostring (player.Character.Leg 2. BackRLeg.BrickColor) |
67 | FrontLpaw = tostring (player.Character.Leg 2. FrontLpaw.BrickColor) |
68 | FrontLLeg = tostring (player.Character.Leg 2. FrontLLeg.BrickColor) |
69 | ShoulderLback = tostring (player.Character.Leg 2. ShoulderLback.BrickColor) |
70 | ShoulderRfront = tostring (player.Character.Leg 2. ShoulderRfront.BrickColor) |
71 | BackLpaw = tostring (player.Character.Leg 2. BackLpaw.BrickColor) |
74 | local viewkey = "Colorsfor" ..player.userId |
77 | game.Players.PlayerRemoving:connect( function () |
80 | local Tosave = { Chest,Neck,Tail 1 ,Tail 2 ,Tail 3 ,bodyfrontA,bodyfrontB |
81 | ,ear 1 ,ear 1 p 2 ,ear 1 p 3 ,ear 2 ,ear 2 p 2 ,ear 2 p 3 ,head,muzzle 1 ,muzzle 2 ,BackLLeg,FrontRpaw,FrontRLeg, |
82 | ShoulderRback,ShoulderLfront,BackRpaw,BackRLeg,FrontLpaw,FrontLLeg,ShoulderLback, |
83 | ShoulderRfront,BackLpaw,Body } |
85 | DataStore:SetAsync(viewkey,Tosave) |