Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Player list on key pressed?

Asked by 10 years ago

So, i made the Playerlist GUI invisible

game:GetService("StarterGui"):SetCoreGuiEnabled("PlayerList", false)

How would i make it so when a player hits a certain key it opens to that player?

1 answer

Log in to vote
1
Answered by 10 years ago

--Local Script

function KeyDownFunctions(key)
    if key == "Q" then
        game:GetService("StarterGui"):SetCoreGuiEnabled("PlayerList", true)
    end
    if key == "E" then
        game:GetService("StarterGui"):SetCoreGuiEnabled("PlayerList", false)
    end
end

Or try this

open = false

function KeyDownFunctions(key) 
    if key == "Q" then
        game:GetService("StarterGui"):SetCoreGuiEnabled("PlayerList", true)
    open = true
end
    if key == "E" then
        game:GetService("StarterGui"):SetCoreGuiEnabled("PlayerList", false)
        open = false
end
end
0
And will this only make it Visible to the player that presses the key? starkiller523 65 — 10y
0
Let me edit it. IntellectualBeing 430 — 10y
Ad

Answer this question