Hi,
Summing the topic up, I want to be able to somehow wait for a localscript. The localscript is located in StarterGui
. All I am doing is sending an remote event containing data to a localscript.
--SERVER
PlayerManager.CharacterAppearanceLoaded:Connect(function(player)
print(os.clock())
CaseInfoRemoteEvent:FireClient(player, rarities, cases)
ItemsInfoRemoteEvent:FireClient(player, items, rarities)
InventoryInfoRemoteEvent:FireClient(player, PlayerInventory.GetInventory())
end)
I’ve also put print(os.clock())
inside the localscript. The problem is that the server fires the event before the localscript is even loaded
19:43:49.008 2095.0324194 - Server - Server:63
19:43:49.151 2095.1759548 - Client - Arsenal:19
What I could do is just add a task.wait(5)
which would work, although when using local server test (as I am developing the project with my friend), this won’t work, it would have to be like task.wait(30)
which is not that optimal. Another possible solution would be just to move the localscript to ReplicatedFirst
and everything would work very well, but that’s why I wrote this post because I would like to keep the localscript inside the startergui. Best solution would be to somehow make the server wait for that localscript to load.