when this script runs to drog an item it creates lag, the first time not so much but reapeating it makes it lag alot and ends up crashing. anyone know why?
local drop = script.Parent
drop.MouseButton1Click:connect(function()
local item = _G. globalslot
local itemobj = item.SlotImage.ItemName.Value
local clone = game.ReplicatedStorage.WorldItemDrops:FindFirstChild(itemobj):Clone()
clone.Parent = game.Workspace
item.SlotImage.Image = ""
item.SlotImage.SlotAmount.Text =""
item.SlotImage.ItemName.Value = ""
drop.Parent.Visible = false
end)

4 comments
testing its script preformance, it rises everytime i use the function
for some reason its the putting the clone in workspace that causes it to lag, but this increases the more i run it
How big is the thing you're trying to clone?
about 2X.5X5