Attempt to index function with 'NextNumber'

	local swingSound = createSound(tool.Handle, properties.SoundProperties, properties.SwingSoundID)
	createPitchShift(swingSound, rng:NextNumber(properties.PitchShiftOctaves.Min, properties.PitchShiftOctaves.Max) )
	swingSound:Play()
	swingSound.Ended:Connect(function()
		swingSound:Destroy()
	end)
	task.wait(properties.SwingCooldown + properties.AnimationDuration)
	swinging = false
end)

Not really sure why I’m getting an error on this 2nd line of code. Says 'attempt to index function with ‘NextNumber’ but it is a number so I don’t know why it doesnt work

full code?

the problem could be using Random.new insead of Random.new()

I can’t believe I missed that. Thank you so much!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.