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

Why dose KeyDown on / not work?


local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()

Mouse.KeyDown:connect(function (key)
	if string.byte(key) == 47 then 
		print("Chat Opened")
		script.Parent.TextBox:CaptureFocus()
		end
end)


script.Parent.TextBox.FocusLost:connect(function()
	if string.sub(script.Parent.TextBox.Text, 1,1) == "/" then
		print(Player.Name .. " Ran a command")
		  workspace.ChatX.AdminByLua.Commands:FireServer(Message, Player)
	else
		x = script.Parent.TextBox.Text
		y = Player.Character.Name
  workspace.ChatX.Chat:FireServer(x,y)
print(x,y)
	end
end)


When i press / in studio test its works but when im online it dosnet work

1 answer

✓ Accepted answer

The '/' key is reserved for the built-in chat hotkey, and will not work in online mode, even if you remove the chatbar GUI.

1 comment

0

Thanks... I will use the "C" key instead thanks for your time

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