I have a GUI that allows the player to insert a string value that the script will find that object in the workspace. For example the player inserts 'game.Workspace.Sound' in the TextBox then the script will find the Sound and do the script.
Error I'm getting
attempt to perform arithmetic (div) on nil and number
game["Run Service"].RenderStepped:Connect(function()
while playing == true do
wait()
local sound = SoundLocation.Text -- TEXTBOX
u1 = sound.PlaybackLoudness / 70; -- ERRORS HERE
u2 = sound.PlaybackLoudness / 750;
l__TweenService__4:Create(workspace.CurrentCamera, TweenInfo.new(u3:NextNumber(0.05, 0.1), Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {
CFrame = workspace.CurrentCamera.CFrame * CFrame.Angles(math.rad(u3:NextNumber(-u1, u1)), math.rad(u3:NextNumber(-u1, u1)), math.rad(u3:NextNumber(-u1, u1)))
}):Play();
end
end);

1 comment
The game is reading it as u1 = SoundLocation.Text.PlaybackLoudness / 70.