Hi, I am making a script which detects if the player has resized their limbs and print it on the client, but it doesn’t print for some reason.
Script:
--local RunService = game:GetService("RunService")
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Limbs = {"Right Leg", "Left Leg", "Right Arm", "Left Arm", "Torso", "Head", "HumanoidRootPart"}
local Sizes = {Vector3.new(1, 2, 1), Vector3.new(1, 2, 1), Vector3.new(1, 2, 1), Vector3.new(1, 2, 1), Vector3.new(2, 2, 1), Vector3.new(2, 1, 1), Vector3.new(2, 2, 1)}
while task.wait(4) do
for _, v in pairs(Character:GetChildren()) do
if v:IsA("Part") then
for Index, Secondary in pairs(Limbs) do
if v.Name == Limbs[Index] and v.Size ~= Sizes[Index] then
print("Limb reize!")
break
end
end
end
end
end
One initial problem I noticed from your code is instead of doing v:IsA("Part") you’d want to use v:IsA("BasePart") so all part types can be detected, because most character limbs are mesh parts.
--local RunService = game:GetService("RunService")
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Limbs = {"Right Leg", "Left Leg", "Right Arm", "Left Arm", "Torso", "Head", "HumanoidRootPart"}
local Sizes = {Vector3.new(1, 2, 1), Vector3.new(1, 2, 1), Vector3.new(1, 2, 1), Vector3.new(1, 2, 1), Vector3.new(2, 2, 1), Vector3.new(2, 1, 1), Vector3.new(2, 2, 1)}
while true do
task.wait(4)
for _, v in pairs(Character:GetChildren()) do
if v:IsA("BasePart") then
for Index, Secondary in pairs(Limbs) do
print(Limbs[Index],Sizes[Index])
if v.Name == Limbs[Index] and v.Size == Sizes[Index] then
print("Limb reize!")
break
end
end
end
end
end
You accidentally put ~= instead of == , and now it works.
local RunService = game:GetService("RunService")
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Limbs = {"Right Leg", "Left Leg", "Right Arm", "Left Arm", "Torso", "Head", "HumanoidRootPart"}
local Sizes = {Vector3.new(1, 2, 1), Vector3.new(1, 2, 1), Vector3.new(1, 2, 1), Vector3.new(1, 2, 1), Vector3.new(2, 2, 1), Vector3.new(2, 1, 1), Vector3.new(2, 2, 1)}
while task.wait(4) do
for _, v in pairs(Character:GetChildren()) do
if v:IsA("BasePart") or v:IsA('UnionOperation') then
for Index, Secondary in pairs(Limbs) do
v:GetPropertyChangedSignal('Size'):Connect(function()
print('Resized')
end)
end
end
end
end