I have this script:
local player = script.Parent.Parent repeat wait() until player.Character game.Players.LocalPlayer.Character:WaitForChild("PlayerSkins").ChildAdded:connect(function(skin) print("Auto saving...") local datastore = game:GetService("DataStoreService"):GetDataStore(player.Name.."Stats")--Player key local statstorage = player.Character:WaitForChild("PlayerSkins"):GetChildren() for i = 1, #statstorage do datastore:SetAsync(statstorage[i].Name, statstorage[i].Value) print(statstorage[i].Value.." Saved succesfully!") wait(.1) end print("Succesfully saved!") end)
I want to test it but it won't do anything when a child is added..
Information:
Script is a NORMAL SCRIPT
Script is in STARTER PLAYER SCRIPTS
I tried:
DescendentAdded
ChildAdded
And none worked.. How do I make it work???
It needs to be a local script in game.StarterPlayer.StarterPlayerScripts