Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Drop script causing wayyy to much lag?

Asked by 6 years ago

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)
0
testing its script preformance, it rises everytime i use the function deerdharok 91 — 6y
0
for some reason its the putting the clone in workspace that causes it to lag, but this increases the more i run it deerdharok 91 — 6y
0
How big is the thing you're trying to clone? XAXA 1569 — 6y
0
about 2X.5X5 deerdharok 91 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

I see no wait() or a debounce.

1
i dont think it needs a wait since it runs only when someone clicks the button, and the button only appears when a gui is made visible when certain requierments are met so i dont think i neeed a debounce either. i think it might be the global variable deerdharok 91 — 6y
Ad

Answer this question