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

How would I make a gui only appear to certain people when they press a certain key? [closed]

Asked by 7 years ago

BAsically what i'm trying to do is make a GUI appear to people when they press a key (Z) and disappear when they press the key as well. However, I only want it to appear for certain people.

I already have a keyDown scripted, but I don't know where to start for making a GUI disappear and reappear, so if anyone can direct me to some sources I could be grateful.

0
Instead of using KeyDown which is deprecated(shouldn't be used anymore) use this http://wiki.roblox.com/index.php?title=API:Class/UserInputService EzraNehemiah_TF2 3552 — 7y

Closed as Not Constructive by EzraNehemiah_TF2, AZDev, and MessorAdmin

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

2 answers

Log in to vote
0
Answered by 7 years ago

All you really have to do is give the gui to certain people (place it in there playergui folder I think) with the keyDown script inside of the gui, so just use something basic to go through the list of people and distribute the gui.

Ad
Log in to vote
0
Answered by
Smaltin 46
7 years ago
Edited 7 years ago

Put this into a SCRIPT, Fill in the script, then you're all set!

local player = game.Players.LocalPlayer

function clicked(Key)
    if Key == "z" and player.Name == "AltLaserthrasher1" then
        game.Players.LocalPlayer.PlayerGui.GUINAME.FrameName.Visible = true
    end
end
game.Players.LocalPlayer:GetMouse().keyDown:connect(clicked)