Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

If statement's multiple layers problem ('and' and 'or')?

I find this really annoying, these are code that make everything in the character go transparent but the right arm parts, but it just makes the whole character goes transparent. For example, if I type like this:

if v:IsA("BasePart") and (v.Name ~= 'RightHand' or v.Name ~= 'RightUpperArm' or v.Name ~= 'RightLowerArm')  then

or this:

if v:IsA("BasePart") and ((v.Name ~= 'RightHand') or (v.Name ~= 'RightUpperArm') or (v.Name ~= 'RightLowerArm'))  then

or even this:

if v:IsA("BasePart") and ((not v.Name == 'RightHand') or (not v.Name == 'RightUpperArm') or (not v.Name == 'RightLowerArm'))  then

or even this one:

if v:IsA("BasePart") and (not (\v.Name == 'RightHand') or not (v.Name == 'RightUpperArm') or not (v.Name == 'RightLowerArm'))  then

All of those still makes the entire character disappear, if you are an expert about these if statement stuff then please let me know how to do it.

2 answers

✓ Accepted answer

This should work; try it.

if v:IsA("BasePart") then
	if not (v.Name == "RightHand" or v.Name == "RightLowerArm" or v.Name == "RightUpperArm") then
		v.Transparency = 1
	end
end
if v:IsA("MeshPart") then
	if v.Name == "RightLowerArm" or if v.Name = "RightHand" or if v.Name = "RightLowerArm" then return end
end

3 comments

0

wrote this on a phone plz tell if works thanks

0

That's not how the if statement works.

0

forgot im mobile but thx

This discussion is preserved as it was. New answers, comments, and votes are closed.