game.ReplicatedStorage.BeepVoice.OnServerEvent:Connect(function(plr,message)
local amount = 1
for Letter = 1,#message do
amount += 1
if string.sub(message,Letter,Letter) == "." then
print("Full stop")
task.wait(0.5)
elseif string.sub(message,Letter,Letter) == "," then
print("Comma")
task.wait(0.25)
else
if amount == 3 then
amount = 1
local sound = script.Sound:Clone()
sound.Parent = plr.Character.Head
sound.PitchShiftSoundEffect.Octave = math.random(5,6)/10
sound:Destroy()
task.wait(0.1)
end
end
end
end)
If you know how to make it sound like the one in lore game, please do tell me how.
Thanks
All you have to do in practice would be to make the pitch lower and increase the delay between each sound, If you can’t figure out the specifics through code I’m sure someone here can help. Though I challenge you to try and figure it out yourself and see how it goes.
Oh sorry I didn’t think that was the problem, Yes there are ways to do that. You could count the amount of spaces and play a sound for each space + one for the starting word, I will look through the Roblox API on strings real quick for anything that can help.
Alright after an hour of tinkering around I got this to work really really well
game.Players.PlayerAdded:Connect(function(plr)
plr.Chatted:Connect(function(message)
coroutine.wrap(function()
local function PlaySound()
--YOUR CODE TO PLAY AUDIO HERE
end
local Words = string.split(message, " ")
for _, V in pairs(Words) do
PlaySound()
if string.match(V,"%p") ~= nil then
if string.match(message,"%p") == "." then
wait(0.3)
print("Period")
elseif string.match(message,"%p") == "," then
wait(0.2)
print("Comma")
end
else
wait(0.1)
print("none")
end
end
end) ()
end)
end)
All of this can go in one Serverscript, no remote events or Localscript needed. doctor it up and tell me how if it works for you. (also don’t forget to change the time it waits to your liking)