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

Why the animation and tween service won't work?

  • TweenService:Create no property named 'b' for object 'Humanoid'??

Thankyou in Advance

local input = game:GetService("UserInputService")
local player = game.Players.LocalPlayer
local tweenService = game:GetService("TweenService")



local animations = {2469483212}



local ready = true











local function Hulk(inputObject)
	if inputObject.KeyCode == Enum.KeyCode.LeftAlt and ready then
		local char = player.Character or player.CharacterAdded:Wait()
		local hum = char.Humanoid
		local animation = Instance.new("Animation")
		local picked = 1
		local tween = TweenInfo.new(1.25,Enum.EasingStyle.Linear,Enum.EasingDirection.In,0,false,0)
		local a = hum.BodyDepthScale.Value
		local b = hum.BodyWidthScale.Value
		local c = hum.BodyHeightScale.Value
		local d	= hum.HeadScale.Value
		
		local change = {a = 2,b = 2,c = 2,d = 3}
			local twin = tweenService:Create(hum,tween,change)
		twin:Play()
		animation.AnimationId = "http://roblox.com/asset/?id="..animations[picked]
		local AnimaTrack = hum:LoadAnimation(animation)
		AnimaTrack:Play()
		wait(1.25)
		ready = false
		
				end
			end
				
				
input.InputBegan:connect(Hulk)

Error: TweenService:Create no property named 'b' for object 'Humanoid'**

4 comments

0

You're attempting to tween a humanoid, but its 'b' property. Humanoids have no 'b' property. You might want to tween the Value if the scales themselves

0

I understand. But i don't know what to do next. :<

0

i did this ! local twin = tweenService:Create({BodyDepthScale;BodyWidthScale;BodyHeightScale;HeadScale},tween,change) twin:Play()

0

Idid this! local twin = tweenService:Create({BodyDepthScale;BodyWidthScale;BodyHeightScale;HeadScale},tween,change) twin:Play()===== but unable to cast value to object

1 answer

The Create method of TweenService takes in three parameters: the instance with which to tween the properties, tween information, and a dictionary containing the properties to change. You have done all the mentioned parameters correctly except for the dictionary. The keys of your dictionary should be the exact name of the property and the value should be the what you want to tween the property to.


--A general example
do
	local instance = ...
	local info = TweenInfo.new(...)
	local change = {
		PropertyName1 = value1;
		PropertyName2 = value2;
		PropertyName3 = value3;
		propertyName4 = value4;
	}
	local tween = TweenService:Create(instance , info , change)
	tween:Play()
end

--A practical example
--Tweens the "Transparency" property of a part in the workspace
do
	local part = workspace.Part
	local info = TweenInfo.new(1)
	local change = {
		Transparency = 1
	}
	local tween = TweenService:Create(part , info , change)
	tween:Play()
end

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