This is the script:
local plr = game.Players.LocalPlayer local char = plr.CharacterAdded:Wait() local hum = char:WaitForChild("Humanoid") local magicbar = script.Parent.Parent local magic = magicbar.MagicEBar local textmagic = magicbar.Amount2 local startergui = game:GetService("StarterGui") local magice = plr:WaitForChild("MagicEnergy") local maxmagice = plr:WaitForChild("MaxMagicEnergy") local function update() magic:TweenSize(UDim2.new(0, magice.Value / maxmagice.Value * 395, .38, 0), "Out", "Quad", 0.1, true) textmagic.Text = math.floor(magice.Value).."/"..math.floor(maxmagice.Value) end magice.Value.Changed:Connect(update) update() startergui:SetCoreGuiEnabled(Enum.CoreGuiType.Health, false)
It's a local script since it's related to the Gui.
The output displays this error:
Players.iiiAmericanLight.PlayerGui.MainGui.HpMagicFrame.Background.MagicEBar.ValueScript:18: attempt to index field 'Value' (a number value)