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

How do I detect when a player presses enter once done typing?

Asked by 3 years ago

I've tried to figure out when a player when a player has finished typing and pressed enter and setting the music player id to that

script.Parent.InputEnded:Connect(function()
    script.Parent.Parent.Parent.Parent.Parent.Sound.SoundId = script.Parent.Text
    script.Parent.Parent.Parent.Parent.Parent.Sound.Playing = true
end)

Though when a player presses enter it does not do anything.

How would I detect it when they press enter? Also I tried printing something before we set the sound and it did not print anything, so I did print(123) right before doing script.Parent.Parent.Parent.Parent.Parent.Sound.SoundId = script.Parent.Text

Please show me how to detect when they finished typing and pressed enter.

0
I don't think its possible but you can make a script when a player types a word the script will play. Sp00ked1 6 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

This is actually pretty easy to do:

script.Parent.InputEnded:Connect(function(enter)
    if enter then
        script.Parent.Parent.Parent.Parent.Parent.Sound.SoundId = script.Parent.Text
        script.Parent.Parent.Parent.Parent.Parent.Sound.Playing = true
    end
end)
Ad

Answer this question