Today i am trying to make part when you touch on it it Double scales you
This is my code
local deb = false
local Number = 2
script.Parent.Touched:Connect(function(hit)
local Character = hit.Parent
if deb ~= true then
deb = true
for i,v in pairs(Character:GetChildren()) do
if v:IsA("Part") or v:IsA("BasePart") or v:IsA("MeshPart") then
v.Size = Vector3.new(v.Size.X * Number, v.Size.Y * Number, v.Size.Z * Number)
end
end
wait(1)
deb = false
end
end)
The issue is the Motor6Ds connecting the parts get unchanged which causes the effect. Try looking at this code in this free model for how to adjust the Motor6D C0 and C1 position in the CFrame property.
This is the easiest way to scale the player’s character. You can check the documentation to make other adjustments.
local deb = false
local Number = 2
script.Parent.Touched:Connect(function(hit)
local Character = hit.Parent
if deb ~= true and game:GetService("Players"):GetPlayerFromCharacter(Character) then --verify that a player touched the part
deb = true
local humanoid = Character:FindFirstChild("Humanoid")
if humanoid then
local descriptionClone = humanoid:GetAppliedDescription()
descriptionClone.HeightScale = Number
descriptionClone.DepthScale = Number
descriptionClone.WidthScale = Number
descriptionClone.HeadScale = Number
humanoid:ApplyDescription(descriptionClone)
end
wait(1)
deb = false
end
end)