function addAuraToInventory(player : Player, aura)
print("done")
for index,slot in pairs(player.PlayerGui.MainGui.Values.Inventory:GetChildren()) do
if slot:IsA("StringValue") then
if slot.Value == "Empty" then
slot.Value = aura
local inventorygui = player.PlayerGui.MainGui.Inventory
inventorygui.InventoryFrame[slot.Name].Text = aura
break
end
end
end
end
The function triggers 1 more every time it fires, its really annoying, can anyone help
Take it out. Every time randomizerarity is called it connects a new MouseButton1Click Event. The MouseButton1Click event should be in the outermost part of the script (meaning it is not in any other functions)