Hi! So I have trouble with UI.
Here the script:
local folder = game.Workspace.TD
local base = folder.Map.Base
local health = base.Health
local maxHealth = base.MaxHealth
local front = script.Parent.Health
local text = script.Parent.HealthLabel
function change()
local t = game:GetService("TweenService"):Create(front,TweenInfo(0.5,Enum.EasingStyle.Linear,Enum.EasingDirection.In,0,false,0), {Size = UDim2.new(health.Value / maxHealth.value),0,1,0})
t:Play()
text.Text = tostring(health.Value).."/"..tostring(maxHealth.Value)
end
change()
health.Changed:Connect(function()
change()
end)
But when I run game it says:
Players.alexsany.PlayerGui.BaseHealth.Bar.UiManager:9: attempt to call a table value - Client - UiManager:9
16:40:56.925 Stack Begin - Studio
16:40:56.925 Script 'Players.alexsany.PlayerGui.BaseHealth.Bar.UiManager', Line 9 - function change - Studio - UiManager:9
16:40:56.926 Script 'Players.alexsany.PlayerGui.BaseHealth.Bar.UiManager', Line 14 - Studio - UiManager:14
16:40:56.926 Stack End - Studio
I couldn’t find topic with same problem.