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

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

Asked by 4 years ago
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

Log in to vote
0
Answered by 4 years ago

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
0
This did not work at all. Thank you for trying though but if I don't click E everything keeps going. JuzeyPlayz -83 — 4y
Ad

Answer this question