Need help with a headless script

Okay, I’ll take a look at it real quick.

Fixed it. ——————————————————- o

Oh mine does work properly, don’t know what you meant earlier.

it was because iw as trying to make a unheadless command, script thats working.

-- THANK YOU TO 49dec FOR HELPING ME WITH THE HEADLESS COMMAND --

joinCommand = "/e headless" or "/e headless "
joinCommand1 = "/e unheadless" or "/e unheadless "

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(chr)
		player.Chatted:Connect(function(msg)
			if msg:sub(1, joinCommand:len()):lower() == joinCommand:lower() then
				-- == "/e headless" or "/e headless " then
				player.Character.Head.Transparency = 1
				player.Character.Head.face.Transparency = 1
			else
				if player.Character.Head.Transparency == 1 then
					if msg:sub(1, joinCommand1:len()):lower() == joinCommand1:lower() then
						player.Character.Head.Transparency = 0
						player.Character.Head.face.Transparency = 0
					end
				end
			end
		end)
	end)
end)
3 Likes

It seems you need to learn how to properly use the OR operator.

2 Likes

No, it works fine like that, don’t get cocky, and refrain from posting on here.

1 Like

I am not being cocky, just simply showing you how your script with ‘less irrelevant coding in it’ does not actually have less than the OP’s script due to an incorrect usage of the OR operator. I will post here if I feel like it, it is relevant to the topic as you are feeding incorrect scripting methods to the forum and OP.

1 Like

I don’t think you should longer post onto this topic, as it’s already marked with my post as the solution, I’m not feeding incorrect scripting methods to the forum, I script the way I want to, and my methods do and will work.

1 Like

And the fact you state, “it is relevant to the topic as you are feeding incorrect scripting methods to the forum and OP” does make me find you a bit cocky and such, however, feel pleased in doing whatever you want, I don’t control the forums either way, just suggesting you not to post onto this topic any longer.

1 Like

I give feedback on how this line has irrelevant code in it and you become toxic, seems like someone cant handle criticism lol

1 Like

No, it’s added there incase ROBLOX captures it the wrong way when firing Player.Chatted

1 Like

that makes no sense at all, care to explain further?
Command = "/e headless" or "/e headless " == Command = "/e headless"
making or "/e headless " irrelevant

1 Like

It’s added there, incase ROBLOX captures the wrong chat fired when firing player.chatted, and you want it exactly as "/e headless" or "/e headless "

1 Like

The or variable is added incase the player chatted /e headless with a space at the end which does happen most of the time in spelling errors.

The fact ROBLOX does break their own platform a lot of numerous times ruining LUA scripts.

1 Like

And none of this is really necessary on this topic, when we could’ve just pm’ed on devforum, therefore, I told you to stop posting onto this topic, as it’s irrelevant as the topic is already marked with a solution.

1 Like

You mean the or operator, and the way you are using it is incorrect. Take this script as an example:

local Text = "a" or "b"
print(Text)
if Text == "a" then
	print("Text is a")
end
if Text == "b" then
	print("Text is b")
end
if Text == "a" or "b" then
	print("third case")
end
if Text == "a" or Text == "b" then
	print("Text is a or b")
end

image

it gives the same result if the Text variable is plainly assigned the string “a”

local Text = "a"
print(Text)
if Text == "a" then
	print("Text is a")
end
if Text == "b" then
	print("Text is b")
end
if Text == "a" or "b" then
	print("third case")
end
if Text == "a" or Text == "b" then
	print("Text is a or b")
end

image

1 Like

Yes, except your script isn’t really being used properly, as it doesn’t make sense in context of what Text is actually being used for, it’s just printing out Text, not in a good proper way.

local a = workspace.a
local b = workspace.b
print(a)
if a then
print("a")
else
print("b")
end
end)
1 Like

It’s an example showing that whether you add the or 'b' or not, the variable will still be the first string provided meaning it would be irrelevant to add the or 'b".

1 Like

What is the point of this script, we are talking about your usage of the OR operator, this script does not contain an OR operator

1 Like

It’s okay, I do my scripting the way I want, if you want to criticize then go ahead, do whatever.

2 Likes