Hello I have trouble to figure why my script looks for HumanoidRootPart’s mass instead of checking the AssemblyMass
local function reduceMass(player)
local character = player.Character
if character then
local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
if humanoidRootPart then
local initialMass = humanoidRootPart.AssemblyMass
print("Player: " .. player.Name .. " - Initial Mass: " .. initialMass)
if initialMass > 20 then
for _, part in ipairs(character:GetDescendants()) do
if part:IsA("BasePart") and part.Name ~= "UpperTorso" and part.Name ~= "LowerTorso" then
part.Massless = true
end
end
local finalMass = humanoidRootPart.AssemblyMass
print("Player: " .. player.Name .. " - Final Mass: " .. finalMass)
end
end
end
end
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
reduceMass(player)
end)
end)
for _, player in ipairs(game.Players:GetPlayers()) do
reduceMass(player)
end