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)

5 comments
If the variable magice is the value object then remove the Value. Changed is an event for the instance not the number returned by .Value
You are a god, type that as an answer so i can accept it.You need to get rewarded xD
Its ok.
@kingdom5 is correct, as you can ONLY change/read the Value property, but not the actual Value instance (acts like (almost) any other instance).
magice.Value.Changed:Connect(update) won't work, use magice:GetPropertyChangedValue("Value"):Connect(update)