Module Script
function Emotes.GetData(player: Player)
local key = "index_" .. player.UserId
local data = EmoteSaving:GetAsync(key)
if data then
EmoteAquiring:FireClient(player, data)
print("Emote data sent: ", data)
else
print("No emote data found for player: " .. player.Name)
end
end
local Template = script.EmoteTemplate
local EmoteAquiring = game.ReplicatedStorage.returnFunction:WaitForChild("EmoteAquiring")
if Template then
EmoteAquiring.OnClientEvent:Connect(function(player, index)
if player then
if not index then
print(index)
end
if index then
for _, i in ipairs(index) do
local newTemplate = Template:Clone()
newTemplate.Parent = script.Parent
newTemplate.Name = i
newTemplate.EmoteName = i
end
end
end
end)
end
It always prints “nil”. Did i perchance do something wrong?