Well, the label is not showing when the button is pressed! Script:
-- VARIABLES local Player = game:GetService("Players").LocalPlayer local Storage = game:GetService("ReplicatedStorage"):FindFirstChild("Storage") local Swords = Storage:WaitForChild("Swords") local Database = Player:WaitForChild("Database") local ValueFolder = Database:FindFirstChild("Value_Inv") local MeltingLabel = script.Parent.Parent.Parent.Parent:FindFirstChild("MeltingInfo") local meltingeffect = script.Parent.Parent.Parent.Parent:FindFirstChild("Melting") -- CODE script.Parent.MouseButton1Click:Connect(function() local debounce = false if ValueFolder.IronOre_Value.Value >= 1 then if not debounce then debounce = true ValueFolder.IronOre_Value.Value = ValueFolder.IronOre_Value.Value - 1 wait() MeltingLabel.Visible = true meltingeffect:Play() wait(3) meltingeffect:Stop() MeltingLabel.Visible = false ValueFolder.IronIngot_Value.Value = ValueFolder.IronIngot_Value.Value + 1 end else -- Code here end wait(1) debounce = false end)
Well, the output is *attempt to index upvalue 'MeltingLabel" (a nil value)! Line 19' *
Explorer ->> https://imgur.com/a/CsCIp0N
I'm assuming this is in a LocalScript. Your code looks fine, try changing the FindFirstChilds to WaitForChilds on lines 3, 6, 7, and 8. Usually, the script runs before such objects are loaded into the game, and thus using FindFirstChild may often return a nil value.
Hope this helps