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

[Medium] How do I make these guis show up?

local sound = Instance.new("Sound", game.Workspace)
sound.SoundId = "rbxassetid://579315881"
sound.Played:Connect(function(soundId)
	
end)
script.Parent.Touched:Connect(function()
	game.StarterGui.Letter.ImageLabel.Visible = true -- its not poping up!
	local UserInputService = game:GetService("UserInputService")
UserInputService.InputBegan:Connect(function(input, gameProcessedEvent)
	if input.KeyCode == Enum.KeyCode.E and not gameProcessedEvent then
			game.StarterGui.Hacking.ImageLabel.Visible = true -- I need this to pop up ONLY after E is clicked on Keybored
		   	   
		end
	end)
sound:Play()
wait(15)
sound:Stop()
game.Workspace["Moving Lazer"]:Destroy()
game.Workspace["Moving Lazer2"]:Destroy()
game.Workspace["Moving Lazer3"]:Destroy()
game.Workspace["Moving Lazer4"]:Destroy()
	
    

end)

Also why does the script move on even tho I did not click E?

1 answer

Hi

I think before you check what key was pressed you need to check what input it was

something like this:

if input.UserInputType == Enum.UserInputType.Keyboard then
	if input.KeyCode == Enum.KeyCode.E then
		-- show gui stuff here.
	end
end

1 comment

0

This did not work at all. Thank you for trying though but if I don't click E everything keeps going.

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