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

Why the animation and tween service won't work?

Asked by 5 years ago
Edited 5 years ago
  • 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'***

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 User#19524 175 — 5y
0
I understand. But i don't know what to do next. :< Pdpieee 1 — 5y
0
i did this ! local twin = tweenService:Create({BodyDepthScale;BodyWidthScale;BodyHeightScale;HeadScale},tween,change) twin:Play() Pdpieee 1 — 5y
0
Idid this! local twin = tweenService:Create({BodyDepthScale;BodyWidthScale;BodyHeightScale;HeadScale},tween,change) twin:Play()===== but unable to cast value to object Pdpieee 1 — 5y

1 answer

Log in to vote
1
Answered by
RayCurse 1518 Moderation Voter
5 years ago

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
Ad

Answer this question