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

How do I add this special character to user input?

I found this in a script but don't know what to replace instead of "GuiService"

--		-- CHatHotKey is '/'
--		GuiService:AddSpecialKey(Enum.SpecialKey.ChatHotkey)
--		GuiService.SpecialKeyPressed:connect(function(key) 
--			if key == Enum.SpecialKey.ChatHotkey then 

So I want to add that "/" character instead of this:

mouse.KeyDown:connect(function (key) -- Run function
	if key == "e" then

2 answers

GuiService is inaccessible to scripts created by users. If you're trying to detect keyboard input, I'd put a LocalScript inside of StarterGui with this code-

wait()
local plr = Game:GetService("Players").LocalPlayer
local mouse = plr:GetMouse()

mouse.KeyDown:connect(function(key)
	print(plr.Name .. " pressed " .. key)
	if key == "e" then
		-- code
	end
end)

1 comment

0

I dont think I made my questions clear. I know how to type all that, but how do I replace "E" with "/". As stupid as that sounds if I just put "/" it wont work.

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