Script
local DataStoreService = game:GetService("DataStoreService")
local currentPackStore = DataStoreService:GetDataStore("CurrentPack")
local repS = game:GetService("ReplicatedStorage")
local updateRemote = repS:FindFirstChild("DataStore")
game.Players.PlayerAdded:Connect(function(player)
local success, err = pcall(function()
currentPackStore:SetAsync(player, "Animation_Default")
end)
if success then
print("[Character System]: Load Successful!")
end
local success, currentAnimPack = pcall(function()
return currentPackStore:GetAsync(player)
end)
if success then
print("[Character System]: Current Pack is ", currentAnimPack)
end
end)
updateRemote.OnServerEvent:Connect(function(pplayer,Pack)
local success, newPack = pcall(function()
return currentPackStore:UpdateAsync(pplayer, Pack)
end)
if success then
print("[Character System]: Save Successful! New Pack is ", newPack)
end
end)
Localscript
local repS = game:GetService("ReplicatedStorage")
local updateRemote = repS:FindFirstChild("DataStore")
script.Parent.TextButton.MouseButton1Click:Connect(function()
updateRemote:FireServer(script.Parent.TextBox.Text)
end)
so , when i press the button with a text or any String , it should print that its saved , but it doesnt do that for some reason :/
