Hello, fellow scripters! I have a task on my hands that I need some help with. I am attempting to grab the mass of a player’s entire body and output its number onto a scale. The code I currently have is using a touching event to grab the mass of every part of the player’s body but it’s not seeming to work. Could someone give me a hand? Thanks to those who can help!
Here is the code:
local Pad = script.Parent
local ScaleText = script.Parent.Parent.Numbers.SurfaceGui.TextBox.Text
local Touching = Pad.CanTouch
ScaleText = "0" .. "LBS"
Touchpad = Pad.Touched:Connect(function(hit)
local LFoot = hit.Parent.LeftFoot.Mass
local LHand = hit.Parent.LeftHand.Mass
local LLowerArm = hit.Parent.LeftLowerArm.Mass
local LLowerLeg = hit.Parent.LeftLowerLeg.Mass
local LUpperArm = hit.Parent.LeftUpperArm.Mass
local LUpperLeg = hit.Parent.LeftUpperLeg.Mass
local LowerTorso = hit.Parent.LowerTorso.Mass
local RFoot = hit.Parent.RightFoot.Mass
local RHand = hit.Parent.RightHand.Mass
local RLowerArm = hit.Parent.RightLowerArm.Mass
local RLowerLeg = hit.Parent.RightLowerLeg.Mass
local RUpperArm = hit.Parent.RightUpperArm.Mass
local RUpperLeg = hit.Parent.RightUpperLeg.Mass
local UpperTorso = hit.Parent.UpperTorso.Mass
local Head =hit.Parent.Head.Mass
print("Calculating weight...")
local weight = LFoot + LHand + LLowerArm + LLowerLeg + LUpperArm + LUpperLeg + LowerTorso + RFoot + RHand + RLowerArm + RLowerLeg + RUpperArm + RUpperLeg + UpperTorso + Head
ScaleText = weight .. "LBs"
wait(5)
ScaleText = "0" .. "LBS"
wait(2)
end)
Here is the object: