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.
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.
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)
thanks
You are welcome.
This discussion is preserved as it was. New answers, comments, and votes are closed.
3 comments
not a request site
not a request site
Use Chatted event.