Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

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

This discussion is preserved as it was. New answers, comments, and votes are closed.