I have an issue with my code, I can't seem to only clone once when a player clicks on the item/part once in the workspace
local objects = require(game.ReplicatedStorage.Modules.Objects)
function CreateUI(name, parent, quantity)
local Template = game.ReplicatedStorage.Guis.Template:Clone()
Template.Parent = parent
Template.quantity.Text = quantity
Template.Name = name
end
clicks = {}
game.ReplicatedStorage.Events.Pickup.OnClientEvent:Connect(function()
for _, items in pairs(game.Workspace:GetChildren()) do
if items:IsA('Part') then
if items.ClickDetector.MouseClick then
CreateUI(items.Name, game.Players.LocalPlayer.PlayerGui.GameUi.InventoryUI.InventoryInset, "5")
if game.Players.LocalPlayer.PlayerGui.GameUi.InventoryUI.InventoryInset:WaitForChild(items.Name) then
end
end
end
end
end)
Ignore objects.

2 comments
Try formatting MouseClick as it’s original RBXScriptSignal form
How do you do that?