In my game, there’s a really weird bug where a cloned Frame from ReplicatedStorage to the PlayerGui ends breaking for a small percentage of user’s. Personally I’ve never experienced this issue, and I don’t know what’s causing it
For breaking the meaning; A folder is not being found
This issue shouldn’t be related to other scripts in the game
I have looked up many similar posts but unfortunately nothing helped.
Really appreciate any help! Thanks
Yield is happening in ModuleScript
Content of localscript
local TweenService, tweenInfo = game:GetService("TweenService"), TweenInfo.new(.15, Enum.EasingStyle.Back, Enum.EasingDirection.Out, 0, false)
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Definition = require(ReplicatedStorage.Modules.Pets.Definition)
local ItemsLib = require(ReplicatedStorage.Modules.Pets.Lib)
local PetsLib = require(script:WaitForChild("PetsLib"))
local gamepassLib = require(ReplicatedStorage.Modules.gamepassLib)
local ButtonAnimation = require(ReplicatedStorage.Modules.ButtonAnimation)
local player = game:GetService("Players").LocalPlayer
for _, item in pairs(PetsLib.Inventory::Types.inventory) do
local asset = ItemsLib:assetById(item.Id)
local template = PetsLib.Assets.Template:Clone()
template.Name = asset.Name
template.Body.Body.Text = `{asset.Boost}`
template.Body.PetImage.Image = `rbxassetid://{asset.Image}`
template.Placeholder.ImageColor3 = Definition[asset.Type].Color
template.LayoutOrder = -asset.Boost*100
template:SetAttribute("Boost", asset.Boost)
template:SetAttribute("Gold", asset.Gold)
template:SetAttribute("Void", asset.Void)
template:SetAttribute("Id", item.Id)
template:SetAttribute("UUID", item.UUID)
template.Body.UIScale.Scale = 0
template.Parent = PetsLib.Label.ScrollingFrame
template.Body.MouseButton1Click:Connect(function()
PetsLib:OnPetImageClick(template)
end)
TweenService:Create(template.Body.UIScale, tweenInfo, { Scale = 1 }):Play()
ButtonAnimation(template.Body)
end
PetsLib:UpdateScrollingFrame()
PetsLib:UpdateSort()
PetsLib.Label.ScrollingFrame:AddTag("PetFramesAdded")
local gamepassBigInventory = gamepassLib.gamepassByName("Big Inventory")
player.gamepasses[gamepassBigInventory.Name].Changed:Connect(function()
PetsLib:UpdateScrollingFrame()
PetsLib:UpdateSort()
end)
ModuleScript
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remoteFunction = ReplicatedStorage.RemoteFunctions.Pets
local Lib = {}
Lib.Label = script.Parent.Parent
Lib.Assets = Lib.Label.InventoryScript.Assets
Lib.Bindables = Lib.Label.InventoryScript.Bindables
Lib.LastSelected = nil :: Frame?
Lib.Sort = "High"
Lib.MultiDelete = false
Lib.Inventory = remoteFunction:InvokeServer("getInventory")
Lib.Equipped = remoteFunction:InvokeServer("getEquipped")
for _, module in pairs(script:WaitForChild("Modules"):GetDescendants()) do
if not module:IsA("ModuleScript") then continue end
task.spawn(function() Lib[module.Name] = require(module) end)
end
for _, module in pairs(Lib.Label.InventoryScript.Interaction:GetChildren()) do
task.spawn(require(module), Lib)
end
return Lib