This script I made is meant to change the size of an R6 character (when detecting that the player has jumped), but it won’t count Scale as a part of the Humanoid, even though changing it manually works anyway.
local char = script.Parent
local hum = char:WaitForChild("Humanoid")
hum.StateChanged:Connect(function(oldState, newState)
if newState == Enum.HumanoidStateType.Jumping then
hum.Parent.Scale *= math.random(-3,3)
end
end)
Your code attempts to change the character model’s scale which isn’t an actual property. Unfortunately, you can’t scale R6 characters like you can with R15 characters so you’ll have to do it manually.
Implemented the new code, and a new error popped up.
local char = script.Parent
local hum = char:WaitForChild("Humanoid")
local Width = 1.5
local Height = 1.5
local Depth = 1.5
local Head = nil
local Vector = Vector3.new(Width, Height, Depth)
hum.StateChanged:Connect(function(oldState, newState)
if newState == Enum.HumanoidStateType.Jumping then
local Player = game:GetService("Players")
if Player == nil then return end
if Player.Character:GetAttribute("Scaled") == true then return end
Player.Character:SetAttribute("Scaled", true)
local Humanoid = Player.Character.Humanoid
if Humanoid.RigType == Enum.HumanoidRigType.R6 then
local Motors = {}
table.insert(Motors, Player.Character.HumanoidRootPart.RootJoint)
for i,Motor in pairs(Player.Character.Torso:GetChildren()) do
if Motor:IsA("Motor6D") == false then continue end
table.insert(Motors, Motor)
end
for i,v in pairs(Motors) do
v.C0 = CFrame.new((v.C0.Position * Vector)) * (v.C0 - v.C0.Position)
v.C1 = CFrame.new((v.C1.Position * Vector)) * (v.C1 - v.C1.Position)
end
for i,Part in pairs(Player.Character:GetChildren()) do
if Part:IsA("BasePart") == false then continue end
Part.Size *= Vector
end
if Player.Character.Head.Mesh.MeshId ~= "" then
Player.Character.Head.Mesh.Scale *= Vector
end
for i,Accessory in pairs(Player.Character:GetChildren()) do
if Accessory:IsA("Accessory") == false then continue end
Accessory.Handle.AccessoryWeld.C0 = CFrame.new((Accessory.Handle.AccessoryWeld.C0.Position * Vector)) * (Accessory.Handle.AccessoryWeld.C0 - Accessory.Handle.AccessoryWeld.C0.Position)
Accessory.Handle.AccessoryWeld.C1 = CFrame.new((Accessory.Handle.AccessoryWeld.C1.Position * Vector)) * (Accessory.Handle.AccessoryWeld.C1 - Accessory.Handle.AccessoryWeld.C1.Position)
Accessory.Handle:FindFirstChildOfClass("SpecialMesh").Scale *= Vector
end
end
end
end)
Not sure if the implementation of the model’s code is right.
You path is “Worspace.ElvinWoman.Model.Scale” there is no folder or object called “Model” you will have to index “Humanoid” if you want to access a child called “Scale”.
You should take a look at the documentation before making a post, it helps.
Anywho, it looks like you’re trying to write a variable that isn’t accessible by code, what you have to do is use the inbuilt method: ScaleTo(ScaleFactor) to change the scale.