Scripts floods output

the script works but it flood my output . how can i fix that


local player = game:GetService("Players").LocalPlayer 
local character = player.Character or player.CharacterAdded:Wait()

game:GetService("RunService").RenderStepped:Connect(function()
	for i, part in pairs(character:GetChildren()) do
		if string.match(part.Name, "Arm") or string.match(part.Name, "Leg") then
			part.LocalTransparencyModifier = 0
		end
	end
end)
1 Like

This script should not flood your Output unless its throwing an Error, But One Asnwer is to create a form of Whitelist to check whether something can be used for not, typically like this:

local Whitelist = {
    -- the boolean is so you can choose to enable/disable it
    -- also im lazy, and do not want to perform another loop
    -- when you can do this

    ["Left Arm"] = true;
    ["Right Arm"] = true;
    ["Left Leg"] = true;
    ["Right Leg"] = true;
}

The Table will have these Names as an Index, and you will need to call them exactly how they are spelled (so make sure you spell what you want right.), you can then check whether you are getting the Part you want using this.

if Whitelist[part.Name] then -- if the index exists
    -- if spelled correctly, or if the index is found, should be true
    part.LocalTransparencyModifier = 0
end

Second Answer is to ensure the Object you have, has the Property you want to change.

The Only Reason I see that you would get an Error here is if string.match() found a matching pattern on another object, to Prevent this, make sure you check its class by using :IsA(), Since we are trying to look for the Players Limbs, its best to use BasePart, to refer to all Parts.

if part:IsA("BasePart") then
    part.LocalTransparencyModifier = 0
end
2 Likes

Please reply with what’s outputting, also @DasKairo gave you very good advices for you.

1 Like

yes it has the propriety i want to change the script works 100 percent just like i said above

1 Like

Show screenshot of your output.

1 Like

1 Like

nevermind guys i figured it out

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.