Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Unable To Cast String to Token [ HP bar script ]?

Asked by 4 years ago
Edited 4 years ago
local char = script.Parent
local gui = script.HealthBar
local humanoid = char.Humanoid

gui.Parent = char.Head

humanoid:GetPropertyChangedSignal("Health"):Connect(function()

    local healthChange = humanoid.Health/humanoid.MaxHealth

    local healthColor = Color3.fromRGB(255,0,0):Lerp(Color3.fromRGB(60,255,0), healthChange)

    gui.Health.Meter:TweenSize(UDim2.new(healthChange,0,1,0),"in","Linear",1)

     gui.Health.Meter.BackgroundColor3 = healthColor


end)

Is it the Tween? I cant tell

1 answer

Log in to vote
0
Answered by 4 years ago

I found out my problem, wow

I forgot TO CAPITALIZE

"In"

so it was wondering what i was sending the string to...

Lesson Learned, DO NOT MISS CAPITALIZE, ITS BAD

Ad

Answer this question