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

How to play a certain sound when a player types a certain thing???

What I wanted to make is a script which plays a certain roblox audio ID once you say something, per example a command.

So per example if player types "Hello" , a sound ID will be played from that players head.

3 comments

0

not a request site

0

not a request site

0

Use Chatted event.

1 answer

Here is an example. You can read more here

game:GetService("Players").PlayerAdded:Connect(function(player)
	player.Chatted:Connect(function(msg) --event that activating when player send message 
		if msg == "Test" then 
			local Sound = Instance.new("Sound")
			Sound.Parent = player.PlayerGui
			Sound.Name = "TestSound"
			Sound.SoundId = "rbxassetid://0000000" -- Put here your soundid
			Sound:Play()
			Sound.Ended:Wait()
			Sound:Destroy()
		end
	end)
end)

2 comments

0

thanks

0

You are welcome.

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