Hi All, im hoping someone can help. (I do not get this problem in Studio,ever)
I clone some tools from server storage and place in backpack, when the player is added.
The player can then equip the tool on client.
Works 100% of the time in Studio, however for some reason over the last say 3-4 days, the published version about 9 out of 10 times it fails and the local players (“Backpack”) is empty but on server it has my tools. It looks like it is failing to replicate the backpack.
To prove this to myself, i created a folder “Inventory” and parented to Player (on server) and put all the tools into that folder. the Inventory folder is replicated correctly 100% of the time.
Hopefully someone has an idea or 2.
thanks in advance
UPDATE : No joy fixing this at all. Workaround just incase anyone else had/having same issue with backpack not replicating to client.
On Server (PlayerAdded Event)
Add a Folder Instance to Player (i called mine Inventory)
When cloning the Tool, make another clone and put 1 in backpack and one in “Inventory” folder
On Client
local script : Check if backpack getchildren count is 0, if so loop pairs on localPlayer.Inventory and set parent to Backpack on each.
All works fine as if the Backpack had been replicated properly (ie this is a manual Replicate method)
Can you show us the code that your experiencing problems with?
Without your source code we cannot provide you any good answers but only assumptions, my assumption would be that the player loads in late that the code runs before the player even joins the game.
If that’s the case then to fix that you can simply just use :WaitForChild() to wait for anything that loads before the player does.
Hi thanks for the reply, i will sort the code, ive tried wait for child etc and the code is def running on PlayerAdded event. WaitForChild just comes inf yield. I will attempt to post script snipets.
Server side : on PlayerAdded Event:
for _,v in pairs(playerTools ) do
local tool = nil
tool = ServerStorageCommon.Templates.Tools[v.GameModel]:Clone()
tool.Name=v.PlayerToolURN --using URN of DB Tool as name
tool.Parent=player.Backpack
end
UPATE:Ive done all the normal things checking table data is there, printing child counts etc etc. All fine on server and studio. Once published child count via localscrip is 0 server is xx correct
That’s a roblox replication problem. You see, when exploiters clone tools, they’ll have the tools, but won’t replicate, unless it’s prison life. Everything does. Anyways, so the problem is that you shouldn’t put it in a folder, just plain tools.
They actually do, prison life is the exception. It’s not about poor remote communication, it just doesn’t check who has it, and it ends on an akward position where I can just clone handcuffs as a prisoner and arrest every prisoner left and right.
hi there, sorry im not following you. So are you saying i should have the tools in StarterPack only and not cloned form server storage ?. I have over 800 tools in my database but only use a few actual tool models, so dont want to make 800+ in studio. Sorry if im miss understanding