I have this character creation system that when the player join into a game the player after being teleported there the player will be given some Int Values as well as its hair,cloths etc. These Int values play a role on what items the character will get. For example. If the int value is 1. Then the player will get the Hair1. If the Int value is 55 the clothing the player will get might be a jacket. Now what im trying to do is save these int values and then whenever the player joins again it will look at the values that i save(Using Data Store) and then add those same hair,clothes etc using those same int values.
Problem
For some reason everything isn't saving. And instead the whole script isn't working. The player does gets it hair or clothes but when i put a print it works. Data Stores are really complicated so if someone could help me on this that would be very helpful.
Look at 1-82 for all GetAsync Parts
Look at 582-593 for all SaveAsync Parts
Server Script
local TeleportService = game:GetService("TeleportService")
local Player = game.Players.LocalPlayer
print("cM..")
local teleportdata = TeleportService:GetLocalPlayerTeleportData()
if teleportdata then
print("sending")
print(teleportdata)
game.ReplicatedStorage.CharacterCustomization.RemoteEvent:FireServer(teleportdata)
print("sent")
end
for i,v in pairs(Player:GetChildren()) do
print(v)
end
if teleportdata == nil then
print("Player did not teleport with New game")
end
Local Script, This is quite long
--//Data Stores//--
local DataStoreService = game:GetService("DataStoreService")
Hair1DD = DataStoreService:GetDataStore("FirstHair2")
local DataStoreService = game:GetService("DataStoreService")
Colour1DD = DataStoreService:GetDataStore("Colour1Data2")
local DataStoreService = game:GetService("DataStoreService")
Hair2DD = DataStoreService:GetDataStore("SecondHair2")
local DataStoreService = game:GetService("DataStoreService")
Colour2DD = DataStoreService:GetDataStore("Colour2Data2")
local DataStoreService = game:GetService("DataStoreService")
FaceDD = DataStoreService:GetDataStore("FaceData2")
local DataStoreService = game:GetService("DataStoreService")
SkinCDD = DataStoreService:GetDataStore("SkinCData2")
local DataStoreService = game:GetService("DataStoreService")
ShirtDD = DataStoreService:GetDataStore("ShirtData2")
local DataStoreService = game:GetService("DataStoreService")
PantDD = DataStoreService:GetDataStore("PantData2")
--New Game Character--
game.ReplicatedStorage.CharacterCustomization.RemoteEvent.OnServerEvent:Connect(function(Player,teleportdata)
local char = Player.Character
local CharacterC = Instance.new("Folder")
CharacterC.Name = "Customization"
CharacterC.Parent = Player
Int = Instance.new("IntValue")
Int.Name = "HairInt"
Int.Value = teleportdata.Hair1D
Int.Parent = CharacterC
--Colour
local IntColour = Instance.new("IntValue")
IntColour.Name = "Colour"
IntColour.Value = teleportdata.ColourD
IntColour.Parent = CharacterC
--Hair2--
local IntHair2 = Instance.new("IntValue")
IntHair2.Name = "Hair2"
IntHair2.Value = teleportdata.Hair2D
IntHair2.Parent = CharacterC
--Colour2--
local IntColour2 = Instance.new("IntValue")
IntColour2.Name = "Colour2"
IntColour2.Value = teleportdata.Colour2D
IntColour2.Parent = CharacterC
--Face--
local IntFace = Instance.new("IntValue")
IntFace.Name = "Face"
IntFace.Value = teleportdata.FaceD
IntFace.Parent = CharacterC
--Skin Colour--
local IntSkinC = Instance.new("IntValue")
IntSkinC.Name = "SkinC"
IntSkinC.Value = teleportdata.SkinCD
IntSkinC.Parent = CharacterC
--Shirt--
local IntShirt = Instance.new("IntValue")
IntShirt.Name = "Shirt"
IntShirt.Value = teleportdata.ShirtD
IntShirt.Parent = CharacterC
--Pant--
local IntPant = Instance.new("IntValue")
IntPant.Name = "Pant"
IntPant.Value = teleportdata.PantD
IntPant.Parent = CharacterC
--//GetAsyncing DataStore//--
Int.Value = Hair1DD:GetAsync(Player.UserId)
IntColour.Value = Colour1DD:GetAsync(Player.UserId)
IntHair2.Value = Hair2DD:GetAsync(Player.UserId)
IntFace.Value = Colour2DD:GetAsync(Player.UserId)
IntFace.Value = FaceDD:GetAsync(Player.UserId)
IntSkinC.Value = SkinCDD:GetAsync(Player.UserId)
IntShirt.Value = ShirtDD:GetAsync(Player.UserId)
IntPant.Value = PantDD:GetAsync(Player.UserId)
if Int.Value == 1 then
local Hair1 = game.ReplicatedStorage.CharacterCustomization.Hair1.Hair1:Clone()
Hair1.Parent = Player.Character
Hair1.Name = "Hair1"
end
if Int.Value == 2 then
local Hair2 = game.ReplicatedStorage.CharacterCustomization.Hair1.Hair2:Clone()
Hair2.Parent = Player.Character
Hair2.Name = "Hair1"
end
if Int.Value == 3 then
local Hair3 = game.ReplicatedStorage.CharacterCustomization.Hair1.Hair3:Clone()
Hair3.Parent = Player.Character
Hair3.Name = "Hair1"
end
if Int.Value == 4 then
local Hair4 = game.ReplicatedStorage.CharacterCustomization.Hair1.Hair4:Clone()
Hair4.Parent = Player.Character
Hair4.Name = "Hair1"
end
if Int.Value == 5 then
local Hair5 = game.ReplicatedStorage.CharacterCustomization.Hair1.Hair5:Clone()
Hair5.Parent = Player.Character
Hair5.Name = "Hair1"
end
if Int.Value == 6 then
local Hair6 = game.ReplicatedStorage.CharacterCustomization.Hair1.Hair6:Clone()
Hair6.Parent = Player.Character
Hair6.Name = "Hair1"
end
if Int.Value == 7 then
local Hair7 = game.ReplicatedStorage.CharacterCustomization.Hair1.Hair7:Clone()
Hair7.Parent = Player.Character
Hair7.Name = "Hair1"
end
if Int.Value == 8 then
local Hair8 = game.ReplicatedStorage.CharacterCustomization.Hair1.Hair8:Clone()
Hair8.Parent = Player.Character
Hair8.Name = "Hair1"
end
if Int.Value == 9 then
local Hair9 = game.ReplicatedStorage.CharacterCustomization.Hair1.Hair9:Clone()
Hair9.Parent = Player.Character
Hair9.Name = "Hair1"
end
if Int.Value == 10 then
local Hair10 = game.ReplicatedStorage.CharacterCustomization.Hair1.Hair10:Clone()
Hair10.Parent = Player.Character
Hair10.Name = "Hair1"
end
if Int.Value == 11 then
local Hair11 = game.ReplicatedStorage.CharacterCustomization.Hair1.Hair11:Clone()
Hair11.Parent = Player.Character
Hair11.Name = "Hair1"
end
end
end)
game.Players.PlayerRemoving:Connect(function(Player)
print(Int)
Hair1DD:SetAsync(Player.UserId, Player.Customization:WaitForChild("HairInt"))
Colour1DD:SetAsync(Player.UserId, Player.Customization:WaitForChild("Colour"))
Hair2DD:SetAsync(Player.UserId, Player.Customization:WaitForChild("Hair2"))
Colour2DD:SetAsync(Player.UserId, Player.Customization:WaitForChild("Colour2"))
FaceDD:SetAsync(Player.UserId, Player.Customization:WaitForChild("Face"))
SkinCDD:SetAsync(Player.UserId, Player.Customization:WaitForChild("SkinC"))
ShirtDD:SetAsync(Player.UserId, Player.Customization:WaitForChild("Shirt"))
PantDD:SetAsync(Player.UserId, Player.Customization:WaitForChild("Pant"))
print("Saved all Data")
end)
Please help me on this Data Store are very complicated for me Thank you
Regards, Bl_ueHistory
**I deleted some parts so it wouldn't be so long SH would accept it
