So I have the following piece of code and the CharacterAdded is not firing, is it because of the vertical order? I mean calling LoadCharacter() before declaring the CharacterAdded event.
local Profile = BaseProfile:Clone();
Profile.Name = Player.Name
Profile.Parent = Profiles
PlayerId = Player.userId;
local PlayerData = DataBase:GetAsync(PlayerId);
DataSlots = Profile:GetChildren();
if PlayerData then
for Key, Value in pairs(DataSlots) do
if PlayerData[Value.Name] then
Value.Value = PlayerData[Value.Name]
Could you please send the output?
The output stays empty, Requesting doesn’t get printed, neither the print inside the module.
Considering the printing isn’t being printed, perhaps the PlayerAdded event isn’t firing. Might want to check that out.
A way you could check if that event isn’t firing is if you try using print prior to it.
Oh the PlayerAdded is firing, the output returns Data Received. I meant none of the prints inside the CharacterAdded event.
The character is loaded before you begin listening to the event (you
:LoadCharacter() then listen for CharacterAdded), therefore the function won’t run.
You can solve this by performing the logic you want after you load the character, i.e:
local function CharacterLoaded(Player)
local Character = Player.Character or Player.CharacterAdded:Wait()
print(Character.Name .. " loaded!")
Thanks! apparently my first thought was correct.