Whenever I set my transparency from 0 to 99 it replaces my torso with a ‘part’, does anyone know why?
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local Character = Player.Character
local Humanoid = Character:WaitForChild("Humanoid")
local TextBox = script.Parent
TextBox.FocusLost:Connect(function(Return)
if not Return then
return
end
if TextBox.Text:match("^%d+$") then
local Transparency = tonumber(TextBox.Text) / 100 -- Assuming the input is a percentage value (0-100)
Transparency = math.clamp(Transparency, 0, 1) -- Clamping the value between 0 and 1
for _, Part in ipairs(Character:GetDescendants()) do
if Part:IsA("BasePart") then
if Part.Name == "Torso" then
else
Part.Transparency = Transparency -- Set other parts' transparency based on the input
end
end
end
end
end)
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local Character = Player.Character
local Humanoid = Character:WaitForChild("Humanoid")
local TextBox = script.Parent
TextBox.FocusLost:Connect(function(Return)
if not Return then
return
end
if TextBox.Text:match("^%d+$") then
local Transparency = tonumber(TextBox.Text) / 100 -- Assuming the input is a percentage value (0-100)
Transparency = math.clamp(Transparency, 0, 1) -- Clamping the value between 0 and 1
for _, Part in ipairs(Character:GetDescendants()) do
if Part:IsA("BasePart") and Part.Name ~= "Torso" and Part.Name ~= "HumanoidRootPart" then
Part.Transparency = Transparency -- Set other parts' transparency based on the input
end
end
end
end)