This issue stems from a previous issue I had yesterday. I’m very new to scripting, and I have a script that creates clones in a radius. There is two issues I have.
I can’t figure out why the pitch of the sounds is not randomized according to the script even though I have a variable which is supposed to do just that.
The sound doesn’t even emit half the time either.
The script is:
local function yes()
Pitch = math.random(.7,1.3)
num1 = math.random(-50,50)
num2 = math.random(-50,50)
num3 = math.random(-50,50)
local Clone = workspace.Part:Clone()
task.spawn(function()
task.wait(2)
Clone:Destroy()
end)
Clone.Position = Vector3.new(num1,num2,num3)
Clone.Parent = workspace
task.wait(0.1)
Clone.Sound.PlaybackSpeed = Pitch
Clone.Sound.Playing = true
Clone.ParticleEmitter:Emit(20)
end
while true do
task.wait(0.5)
yes()
end
Another issue I might want to tackle is that I can’t get the clones to spawn faster than a certain rate. (Around a 10th of a second)