Part that disappears when chatting emote broken

For some reason, a script that I use to make something happen to a part via emote seems to be broken. I have not recently modified anything related to them in any way.

server script:

local Players = game:GetService("Players")

Players.PlayerAdded:Connect(function(player)
	player.Chatted:Connect(function(message)
		if message == "/e YOUWILLNEVERDECODETHIS" then
			game.ReplicatedStorage.pharaoh:FireClient(player)
		end
	end)
end)

local script:

local TextChatService = game:GetService("TextChatService")
local Players = game:GetService("Players")
local player = Players.LocalPlayer

game.ReplicatedStorage.pharaoh.OnClientEvent:Connect(function()
	print("fired")
	local spep = workspace:FindFirstChild("blockerof")
	if spep and spep:IsA("BasePart") then
		print("found")
		spep.Transparency = 1
		spep.CanCollide = false
	end
end)

How can it be fixed?

You can try this. I think there’s a trouble with prefix

local Players = game:GetService("Players")
local commandPrefix = "/e"
local emoteName = "YOUWILLNEVERDECODETHIS"

Players.PlayerAdded:Connect(function(player)
	player.Chatted:Connect(function(message)
		local cleanedMessage = string.lower(message) -- Make message lowercase for easier checking

		if string.sub(cleanedMessage, 1, string.len(commandPrefix)) == commandPrefix then
			local command = string.sub(cleanedMessage, string.len(commandPrefix) + 2) -- Get the string after "/e "

			if command == string.lower(emoteName) then
				game.ReplicatedStorage.pharaoh:FireClient(player)
			end
		end
	end)
end)

Tried it, did not seem to work. (forum character limit)

The reason why it isn’t working is because “/e” is part of the Roblox’s integral commands. “/e” is usually used for playing default Roblox animations. So when you type your password:

The Roblox chat bubble will give you an error message saying “You do not own that emote”, causing the player.Chatted event to not get fired. A simple fix would be to change your secret keyword to something else that doesn’t involve a command.

1 Like