So I want to add a secret message that prints in the output as an easter egg. I have so far used a linear searching function, but I am not sure how to implement pressing the F9 key into this function.
So far I have used:
local inputservice = game:GetService('UserInputService') local keyspushed = inputservice:GetKeysPressed() local function tableContains(tbl, element) for _, v in ipairs(element) do if (rawequal(v, element)) then return true; end end return false; end
Where do I put my variables? Thanks.
Can you not do something like this?
local UIS = game:GetService(“UserInputService”) UIS.InputBegan:Connect(function(Input, IsTyping) If IsTyping == true then return end -- This is optional I use it because it’s really useful if Input.KeyCode == Enum.KeyCode.F9 then print(“Pressed F9!”) -- Make your Easter egg here end end)
How To Check If A Player Has The Developer Console Open:
~Developer Console Can Only Be Found Through Local Script~
-- Local Script -- local plr = game:GetService("Players").LocalPlayer local CoreGui = game:GetService("CoreGui") local DevConsoleMaster = CoreGui:FindFirstChild("DevConsoleMaster") local MainView = DevConsoleMaster:FindFirstChild("MainView",true) if MainView then print(plr.Name .. " has the Developer Console Open") end --[[ Note: MainView is only an existing instance when Developer Console is opened. --]]